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 the server
int count = 0;
String abc;
File[] files = folder.listFiles();
if (files != null) {
System.out.println("IN IF method");
for (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 is showing only some files at path/folder on the server. Other files can't be viewed. Login and logout happens successfully.