我将以下代码的isDirectory()值设为false: -
public void validateFile() throws IOException {
File dir = new File(Labels.INPUT_FILE_DIR).getCanonicalFile();
// Labels.INPUT_FILE_DIR is ./Input (i.e. my Input folder in UNIX server
String code, fileName = "";
ArrayList<String> fileList = new ArrayList<String>();
Logger.info(cName,mName,"");
System.out.println("dir.isDirectory() " + dir.isDirectory()); // getting false here
if (dir.isDirectory()) {
for (File tempFile : dir.listFiles()) {
System.out.println("inside the for loop ");
}
}
}
我做错了吗? 有谁可以帮帮我。
答案 0 :(得分:1)