Examples of SmbFileInputStream


Examples of jcifs.smb.SmbFileInputStream

    }
    public static void main(String[] args) {
        //jcifs.Config.setProperty( "jcifs.netbios.wins", "192.168.1.220" );
        //NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication("domain", "username", "password");
        SmbFileInputStream in;
        try {
            SmbFile sf = new SmbFile(args[0]);
            if (sf.isDirectory()) {
                String[] s = sf.list();
                for (String t: s) System.out.println(t);
            } else {
                in = new SmbFileInputStream(sf);
                byte[] b = new byte[8192];
                int n;
                while(( n = in.read( b )) > 0 ) {
                    System.out.write( b, 0, n );
                }
            }
        } catch (SmbException e) {
            Log.logException(e);
View Full Code Here

Examples of jcifs.smb.SmbFileInputStream

        return null;
    }

    public InputStream getInputStream(final String userAgent, final int timeout) throws IOException {
        if (isFile()) return new FileInputStream(getFSFile());
        if (isSMB()) return new SmbFileInputStream(getSmbFile());
        if (isFTP()) {
            final FTPClient client = new FTPClient();
            client.open(this.host, this.port < 0 ? 21 : this.port);
            final byte[] b = client.get(this.path);
            client.CLOSE();
View Full Code Here

Examples of jcifs.smb.SmbFileInputStream

        return null;
    }

    public byte[] get(final String userAgent, final int timeout) throws IOException {
        if (isFile()) return read(new FileInputStream(getFSFile()));
        if (isSMB()) return read(new SmbFileInputStream(getSmbFile()));
        if (isFTP()) {
            final FTPClient client = new FTPClient();
            client.open(this.host, this.port < 0 ? 21 : this.port);
            final byte[] b = client.get(this.path);
            client.CLOSE();
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.