Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
32 Cards in this Set
- Front
- Back
Outputstream class write method - overwrite/append/fail
|
Depends on constructor parameters. Default - overwrite
|
|
StandardOpenOption constants
|
WRITE – Opens the file for write access.
APPEND – Appends to the EOF. Used with the WRITE or CREATE options. TRUNCATE_EXISTING – Truncates the file to zero bytes. Used with the WRITE option. CREATE_NEW – Creates a new file and throws an exception if the file already exists. CREATE – Opens the file if it exists or creates a new file if it does not. DELETE_ON_CLOSE – Deletes the file when the stream is closed. Useful for temporary files. SPARSE SYNC – Keeps the file (both content and metadata) synchronized with the underlying storage device. DSYNC – Keeps the file content synchronized with the underlying storage device. |
|
Files.copy method if target file doesn't exist
|
create new file
|
|
Return type of File.listFiles()
|
File[]
|
|
Path.subPath indexing
|
Begin with 0. Root not included. Last element = endIndex-1.
|
|
Path.resolve method
|
If target = absolute path, method return target. If target = empty, method return source (this) path. Method joins the target path to this path and returns path that ends with the given path.
|
|
BasicFileAttributes view attributes
|
"lastModifiedTime"
"lastAccessTime" "creationTime" "size" "isRegularFile" "isDirectory" "isSymbolicLink" "isOther" "fileKey" |
|
FileReader construnctors
|
FileReader(String), FileReader(File)
|
|
FileVisitResult constants
|
CONTINUE
SKIP_SIBLINGS SKIP_SUBTREE TERMINATE |
|
PathMatcher class usage
|
PathMatcher matcher = FileSystems.getDefault().getPathMatcher("glob:" + pattern)
if (matcher.matches(filename)) |
|
Method to retrieve console
|
System.console()
|
|
Console.readPassword() return type
|
char[]
|
|
Path relativize() method.
Path p1 = Paths.get("home"); Path p3 = Paths.get("home/sally/bar"); Path p1_to_p3 = p1.relativize(p3); Path p3_to_p1 = p3.relativize(p1); |
Doesn't take Strings as arguments.
Constructs a relative path between this path and a given path. // Result is sally/bar // Result is ../.. |
|
Path.getName() indexing
|
Starts with 0. Root not included.
|
|
StandardWatchEventKinds
|
ENTRY_CREATE
ENTRY_DELETE ENTRY_MODIFY OVERFLOW |
|
WatchKey states
|
Ready
Invalid Signaled |
|
Which WatchService method retrieves and removes the next watch key, waiting if necessary up to the specified wait time if none are yet present?
|
poll(long timeout, TimeUnit unit)
|
|
Which of the StandardWatchEventKinds are automatically registered? Which event count is always 1?
|
OVERFLOW event is automatically registered. ENTRY_CREATE and ENTRY_DELETE event's count is always 1.
|
|
What does Path.getRoot() method return if the root is C - drive?
|
C:\
|
|
List main FileReader constructors
|
FileReader(File file)
FileReader(String fileName) |
|
What does return readLine() method of Reader class?
|
There is no such method in Reader class.
|
|
Which is the return type of getRootDiretories() method?
|
Iterable<Path>
|
|
Path resolveSibling() method. What if path argument is absolute or there is no parent?
|
Resolves the given path against this path's parent. Example path represents "dir1/dir2/foo", then invoking this method with the Path "bar" will result in the Path "dir1/dir2/bar".If argument is absolute or there is no parent - return argument.
|
|
Path normalize() method. What is the result of Paths.get("c:\\..\\temp\\test.txt").normalize(). Explain.
|
Doesn't check at the file system when it cleans up a path. Purely syntactic operation. If a ".." is preceded by a non-".." name then both names are considered redundant. ".." is redundant name. c:/temp/test.txt
|
|
List main Console methods with return types.
|
readLine() - String, readPassword() - char[], reader() - Reader, writer() - PrintWriter
|
|
If serialized object has reference variable that points to class which doesn't implement Serializable interface
|
This variable should be made transient
|
|
how to implement void writeObject(oos)
|
oos.defauktWriteObject;
statements to write parameters of fields that are not serizlized |
|
transient filed when deserialized are given
|
default values for the type. not constructor's values
|
|
Deserializing - inherited values from supertypes are defined by
|
Supertype constructrors
|
|
PosixFileAttributes view attributes
|
owner
group permissions |
|
Paths.get("c:\\finance\\data\\reports\\daily\\pnl.txt").subPath(0, 2)
|
finance\data - no ending slash
|
|
Path get(URI uri) exceptions
|
IllegalArgumentException - if preconditions on the uri parameter do not hold. The format of the URI is provider specific.
FileSystemNotFoundException - The file system, identified by the URI, does not exist and cannot be created automatically, or the provider identified by the URI's scheme component is not installed SecurityException - if a security manager is installed and it denies an unspecified permission to access the file system |