0

'Node' is the path of the directory from where I want to read the contents of the file. I tried the following example but it is failing at node.isDirectory(). Thanks in advance for help

File node = file:\\111.11.11.111\\opt\\MyDir
if (node.isFile()) {
          filelist.add(generateZipEntry(node.getAbsoluteFile().toString()));
        }

    if (node.isDirectory()) {
        String[] subNote = node.list();
        for (String filename : subNote) {
            generateFileList(new File(node, filename));
        }
    }
Anand Dwivedi
  • 1,452
  • 13
  • 23
bibhu_bioit
  • 97
  • 1
  • 9
  • What error are you seeing? It's hard to help debug an issue without a stack trace or at least the basic error message. – Ben Simmons Jan 14 '16 at 05:43
  • Hey Ben, Its not failing it is returning false at node.isDirectory(). It is a directory so the code should return true. I am not sure whether my code is able to access the directory or not. PLease help me with a piece of code which can access the remote unix directory. – bibhu_bioit Jan 14 '16 at 05:49
  • http://stackoverflow.com/questions/12615475/basics-reading-writing-remote-files-using-java – Ben Simmons Jan 14 '16 at 05:58

0 Answers0