sp; // Parameters check.
if(\"-d\".equals(type) || \"--directory\".equals(type)) {
type = Type.DIRECTORY;
} else if(\"-f\".equals(type) || \"--file\".equals(type)) {
type = Type.FILE;
} else {
System.err.println(USAGE);
return;
}
// Check file type
if(Type.FILE.equals(type)) {
if(path.length() <= 3 || !isJsFile(path)) {
System.err.println(\"The file must be a JS file.\");
return;
}
}
// Start message
System.out.println(startMsg);
[Page]
// Format file(s)
try {
if(Type.FILE.equals(type)) {
formatFile(path);
} else {
List<String> jsFileList = getJsFileList(path);
Iterator<String> it = jsFileList.iterator();
while(it.hasNext()) {
formatFile(it.next());
}
&