Consider the following program:
import java.io.IOException; import java.nio.file.*; class Main {//from w ww . ja v a 2s . co m public static void main(String []args) { Path currPath = Paths.get("."); try (DirectoryStream<Path> javaFiles = Files.newDirectoryStream (currPath, "*.{java}")) { for(Path javaFile : javaFiles) { System.out.println(javaFile); } } catch (IOException ioe) { System.err.println("IO Error occurred"); System.exit(-1); } } }
Which one of the following options correctly describes the behavior of this program?
InvalidArgumentException
.d)
The path "." specifies the current directory.
The glob pattern "*.{java}" matches file names with suffix .java.