Package jcifs.smb

Examples of 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);
        }
    }
View Full Code Here


import jcifs.smb.SmbFile;

public class IsDir {

    public static void main( String argv[] ) throws Exception {
        SmbFile f = new SmbFile( argv[0] );
        System.out.println( f.isDirectory() );
    }
View Full Code Here

public class Length {

    public static void main( String argv[] ) throws Exception {

        SmbFile f = new SmbFile( argv[0] );
        System.out.println( argv[0] + "'s length is " + f.length() );
    }
View Full Code Here

public class OpenExclusive {

    public static void main( String argv[] ) throws Exception {
        SmbFileOutputStream out;
        SmbFile f = new SmbFile( argv[0], "", null, SmbFile.FILE_NO_SHARE );
        out = new SmbFileOutputStream( f );
System.in.read();
        out.close();
System.in.read();
// OR
View Full Code Here

public class Get {

    public static void main( String argv[] ) throws Exception {

        SmbFile f = new SmbFile( argv[0] );
        SmbFileInputStream in = new SmbFileInputStream( f );
        FileOutputStream out = new FileOutputStream( f.getName() );

        long t0 = System.currentTimeMillis();

        byte[] b = new byte[8192];
        int n, tot = 0;
View Full Code Here

            }
        }
    }

    public void run () {
        SmbFile f = null;
        int runs = 0;
        while(true) {
            try {
                Thread.sleep(100);
            }catch (InterruptedException e) {}

            while (f == null) {
                try {
                    f = new SmbFile(url, auth);
                } catch (Exception e) {
                    System.err.println(e.getMessage());
                    e.printStackTrace();
                }
            }
View Full Code Here

public class Equals {

    public static void main( String argv[] ) throws Exception {

        SmbFile f1 = new SmbFile( argv[0] );
        SmbFile f2 = new SmbFile( argv[1] );
System.out.println( f1 );
System.out.println( f2 );
        System.err.println( f1.equals( f2 ));
    }
View Full Code Here

        int count = Integer.parseInt(argv[1]);

        for ( ;; ) {
            try {
                SmbFile f = new SmbFile(argv[0]);
                SmbFile[] list = f.listFiles();
                System.out.println("Successfully listed resource: " + list.length);
            } catch (SmbException se) {
                se.printStackTrace();
            }
View Full Code Here

            sem.V();
        }
    }

    T2Crawler( String dir, int numThreads, int depth ) throws Exception {
        SmbFile top = new SmbFile( dir );
        Semaphore sem = new Semaphore( numThreads );
        SmbFile[] l = null;
        int i = 0;

        try {
            l = top.listFiles();
            depth--;
            for( i = 0; i < l.length; i++ ) {
                try {
                    System.out.println( l[i] );
                    if( !l[i].isDirectory() || l[i].isHidden() ) {
View Full Code Here

            this.sem = sem;
            this.depth = depth;
        }

        public void run() {
            SmbFile d;
            SmbFile l[];

            while( list.isEmpty() == false ) {
                int i;
                d = (SmbFile)list.remove( 0 );
                try {
View Full Code Here

TOP

Related Classes of jcifs.smb.SmbFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.