java - This code is showing only some files on the server.Other files can't be viewed -
public void checkfile (string servername) throws exception { if (servername == null) servername = ""; system.out.println("in check file method"); file folder = new file("d:\\mvxout412"); //path on server int count = 0; string abc; file[] files = folder.listfiles(); if (files != null) { system.out.println("in if method"); (int i=0;i<files.length ;i++) { count++; abc = files[i].getname(); system.out.println("number of files: " + count); system.out.println("name of files: " + abc); } } }
this code showing files @ path/folder on server. other files can't viewed. login , logout happens successfully.
public void listfilesforfolder(final file folder) { (final file fileentry : folder.listfiles()) { if (fileentry.isdirectory()) { listfilesforfolder(fileentry); } else { system.out.println(fileentry.getname()); } } } final file folder = new file("/home/you/desktop"); listfilesforfolder(folder);
Comments
Post a Comment