nerdexam
Oracle

1Z0-805 · Question #82

Which two scenarios throw FileSystemNotFoundException when the paths.get(URI) method is invoked?

The correct answer is B. When the provider identified by the URI'S scheme component is not installed D. When the file system identified by the uri does not exist and cannot be created automatically. 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. Note: This method converts the given URI to a Path object. It throws the following exceptions…

Java I/O Fundamentals

Question

Which two scenarios throw FileSystemNotFoundException when the paths.get(URI) method is invoked?

Options

  • AWhen preconditions on the uri parameter do not hold
  • BWhen the provider identified by the URI'S scheme component is not installed
  • CWhen a security manager is installed and it denies an unspecified permission to acess the file system.
  • DWhen the file system identified by the uri does not exist and cannot be created automatically
  • EWhen the path string cannot be converted to a Path

How the community answered

(40 responses)
  • A
    5% (2)
  • B
    80% (32)
  • C
    13% (5)
  • E
    3% (1)

Explanation

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. Note: This method converts the given URI to a Path object. It throws the following 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

Topics

#FileSystemNotFoundException#Paths.get URI#NIO.2#file system provider

Community Discussion

No community discussion yet for this question.

Full 1Z0-805 Practice