All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jcifs_1.3.3.examples.SmbTimeout Maven / Gradle / Ivy

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:  ");
            return;
        }
        String smbRoot = p_args[0];
        int sleepTime = Integer.parseInt(p_args[1]);
        jcifsScan(smbRoot,sleepTime);
    }
        
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy