/usr/share/doc/libjcifs-java/examples/SmbTimeout.java is in libjcifs-java-doc 1.3.19-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | import jcifs.smb.SmbFile;
public class SmbTimeout {
public static void jcifsScan(String root, int sleepTime) throws Exception {
long start = System.currentTimeMillis();
SmbFile smbRoot = new SmbFile(root);
SmbFile[] files = smbRoot.listFiles();
for(SmbFile f : files) {
System.out.println( f + ": " + f.canRead()+" : "+ f.length() + ": " + (System.currentTimeMillis()-start));
Thread.sleep(sleepTime);
}
}
public static void main(String[] p_args) throws Exception {
if(p_args.length!=2) {
System.out.println("Usage: <smbroot> <sleeptime(ms)>");
return;
}
String smbRoot = p_args[0];
int sleepTime = Integer.parseInt(p_args[1]);
jcifsScan(smbRoot,sleepTime);
}
}
|