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);
}
}
}
此代码仅显示服务器上路径/文件夹中的一些文件。其他文件无法查看。登录和注销成功发生。