In Learn > The Java I/O API > File System Basics > Managing File Attributes, section "Determining MIME Type", there is a missing closing parenthesis:
try {
String type = Files.probeContentType(filename);
if (type == null) {
System.err.format("'%s' has an" + " unknown filetype.%n", filename);
} else if (!type.equals("text/plain") { // <-- parenthesis missing here
System.err.format("'%s' is not" + " a plain text file.%n", filename);
continue;
}
} catch (IOException x) {
System.err.println(x);
}
I also get a compiler error about the continue statement: "error: continue outside of loop". (I presume the code was copied originally from a loop.)
In Learn > The Java I/O API > File System Basics > Managing File Attributes, section "Determining MIME Type", there is a missing closing parenthesis:
I also get a compiler error about the
continuestatement: "error: continue outside of loop". (I presume the code was copied originally from a loop.)