Package jcifs.smb

Examples of jcifs.smb.SmbFile.listFiles()

@return An array of SmbFile objects representing fileand directories, workgroups, servers, or shares depending on the context of the resource URL

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

        SmbFile file = new SmbFile( argv[0] );

        long t1 = System.currentTimeMillis();
        SmbFile[] files = file.listFiles();
        long t2 = System.currentTimeMillis() - t1;

        for( int i = 0; i < files.length; i++ ) {
            System.out.println( " " + files[i].getURL().toExternalForm()  + " ");
        }
View Full Code Here


    public URL getURL() throws FileSystemException {
      try {
        file = createSmbFile(getName());

        SmbFile parent = new SmbFile(file.getParent());
        SmbFile[] tmp = parent.listFiles(new SmbFileFilter() {
           public boolean accept(SmbFile f) {
             return f.getName().equals(file.getName());
           }
        });
View Full Code Here

            Subject subject = new Subject();
            login(subject);

            // list file
            SmbFile file = new SmbFile(URL, new Kerb5Authenticator(subject));
            SmbFile[] files = file.listFiles();
            for( int i = 0; i < files.length; i++ ) {
                System.out.println( "-->" + files[i].getName() );
                System.out.println("DFS path: " + files[0].getDfsPath());
            }
View Full Code Here

    // add DFS support
    SmbFile[] children = null;
    try
    {
      currentDirectory.connect();
      children = currentDirectory.listFiles(new DirectoryFilter());
    }
    catch (SmbException se)
    {
      try
      {
View Full Code Here

    // add DFS support
    SmbFile[] children = null;
    try
    {
      currentDirectory.connect();
      children = currentDirectory.listFiles(new DirectoryFilter());
    }
    catch (SmbException se)
    {
      try
      {
View Full Code Here

                        } else {
                            d = new SmbFile(conn, dir);
                        }
                    }
                    long t0 = System.currentTimeMillis();
                    SmbFile[] list = d.listFiles(wildcard);
                    t0 = System.currentTimeMillis() - t0;
                    if (list != null) {
                        for (int j = 0; j < list.length; j++) {
                            StringBuffer sb = new StringBuffer();
                            Date date = new Date(list[j].lastModified());
View Full Code Here

    // add DFS support
    SmbFile[] children = null;
    try
    {
      currentDirectory.connect();
      children = currentDirectory.listFiles(new DirectoryFilter());
    }
    catch (SmbException se)
    {
      try
      {
View Full Code Here

            SmbFile fx = new SmbFile(pwd, getAuth());

            //System.out.println(pwd);
            //if(fx == null) System.out.println("Smb: fx null");
            SmbFile[] f = fx.listFiles();

            //Log.debug("sortLs: file is there and listed");
            //if(f == null) System.out.println("Smb: f null");
            files = new String[f.length];
            size = new String[f.length];
View Full Code Here

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

        for (int a = 0; a < argv.length; a++) {
            SmbFile file = new SmbFile( argv[a], NtlmPasswordAuthentication.ANONYMOUS );
            SmbFile[] files = file.listFiles();
            for( int i = 0; i < files.length; i++ ) {
                System.out.print( " " + files[i].getName() );
            }
        }
    }
View Full Code Here

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

        SmbFile file = new SmbFile( argv[0] );

        long t1 = System.currentTimeMillis();
        SmbFile[] files = file.listFiles();
        long t2 = System.currentTimeMillis() - t1;

        for( int i = 0; i < files.length; i++ ) {
            System.out.print( " " + files[i].getName() );
            switch(files[i].getType()) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.