Package jcifs.smb

Examples of jcifs.smb.SmbFile


        try
        {
            file = toSMB(file);

            out = new BufferedOutputStream(new SmbFileOutputStream(new SmbFile(file,
                                                                               getAuth())));
            in = new BufferedInputStream(i);

            byte[] buf = new byte[smbBuffer];
            int len = 0;
View Full Code Here


    {
        file = toSMB(file);

        try
        {
            return new BufferedInputStream(new SmbFile(file, getAuth()).getInputStream());
        }
        catch(Exception ex)
        {
            ex.printStackTrace();
            Log.debug(ex.toString() +
View Full Code Here

        try
        {
            file = toSMB(file);
            to = toSMB(to);

            SmbFile src = new SmbFile(file, getAuth());

            src.renameTo(new SmbFile(to, getAuth()));

            return true;
        }
        catch(Exception ex)
        {
View Full Code Here

public class AllocInfo {

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

        SmbFile f = new SmbFile( argv[0] );
        System.out.println( f.getDiskFreeSpace() );
    }
View Full Code Here

public class ListFilesAnon {

    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

import jcifs.smb.SmbException;

public class SetTime {

    public static void main( String argv[] ) throws Exception {
        SmbFile f = new SmbFile( argv[0] );
        long time = f.getLastModified();
        f.setLastModified( time + 65000 ); /* add 1 minute and 5 seconds */
    }
View Full Code Here

public class List {

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

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

        long t1 = System.currentTimeMillis();
        String[] files = file.list();
        long t2 = System.currentTimeMillis() - t1;

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

public class ListTypes {

    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

    static final String[] types = { "TYPE_FILESYSTEM", "TYPE_WORKGROUP",
        "TYPE_SERVER", "TYPE_SHARE", "TYPE_NAMED_PIPE", "TYPE_PRINTER", "TYPE_COMM" };

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

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

        switch( file.getType() ) {
            case SmbFile.TYPE_FILESYSTEM:
                type = 0;
                break;
            case SmbFile.TYPE_WORKGROUP:
                type = 1;
                break;
            case SmbFile.TYPE_SERVER:
                type = 2;
                break;
            case SmbFile.TYPE_SHARE:
                type = 3;
                break;
            case SmbFile.TYPE_NAMED_PIPE:
                type = 4;
                break;
            case SmbFile.TYPE_PRINTER:
                type = 5;
                break;
            case SmbFile.TYPE_COMM:
                type = 6;
                break;
            default:
                throw new RuntimeException( "Unknown service type: " + file.getType() );
        }
        System.out.println( types[type] );
        System.out.println();

        long t1 = System.currentTimeMillis();
        String[] files = file.list();
        long t2 = System.currentTimeMillis() - t1;

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

    ThreadedSmbCrawler( String dir, int maxDepth, int numThreads ) throws Exception {
        this.maxDepth = maxDepth;
        this.numThreads = numThreads;
        threads = new Thread[numThreads];
        dirList = new LinkedList();
        dirList.add( new DirEntry( new SmbFile( dir ), maxDepth ));
    }
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.