Java File I/O (NIO.2) Flashcards
Which Path method is used to append a partial path to an existing Path object?
resolve
Which interface should you implement to filter files based on criteria other than the file name?
DirectoryStream.Filter
Which element will be retrieved from the path C:\paul\young\java7\804.java when executing the method getName(1)?
young
Remember base zero.
Which StandardWatchEventKinds event type indicates that a directory entry has been newly created or an existing entry has been renamed?
ENTRY_CREATE
What are the four StandardWatchEventKinds?
ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY, and OVERFLOW
Which StandardWatchEventKinds event is used to indicate that events may have been lost or discarded?
OVERFLOW
Which StandardWatchEventKinds event is used to indicate that a directory entry has been deleted or renamed out of the directory?
ENTRY_DELETE
Which StandardWatchEventKinds event is used to indicate that a directory entry has been modified?
ENTRY_MODIFY
Which StandardOpenOption enumeration value will only synchronize file content with the underlying drive?
DSYNC
What is the signature for the method PathMatcher.matches?
It accepts a Path argument and returns a Boolean value indicating whether there is a match.
Which FileSystem method accepts a string that supports either regular expressions or glob patterns?
getPathMatcher
What is a glob pattern?
An optional string to limit the returned entries to those that match.
Which StandardWatchEventKinds event type indicates that a directory entry has been deleted or an existing entry has been renamed outside the directory?
ENTRY_DELETE
Which exception is thrown if a path string cannot be converted to a Path object?
InvalidPathException
Which Path method converts .. and . into the syntactic directory locations so that only the named elements are contained in the Path object?
normalize
Which Path method converts a relative Path object into an absolute Path object?
toAbsolutePath
Which Path method is used to determine the relative path between two Path objects?
relativize
Which StandardOpenOption enumeration value will synchronize both file content and metadata with the underlying drive?
SYNC
Which StandardOpenOption enumeration value will create a file or open the existing file if it already exists?
CREATE
Which BasicFileAttributeView subinterface supports the legacy attributes archive, hidden, readonly, and system?
DosFileAttributeView
Which BasicFileAttributeView subinterface adds the attribute owner?
FileOwnerAttributeView