Package com.enterprisedt.net.ftp

Examples of com.enterprisedt.net.ftp.FileTransferOutputStream


        return put(srcStream, remoteFile, false);
    }

    public String put(InputStream srcStream, String remoteFile, boolean append)
            throws IOException, FTPException {
        FileTransferOutputStream str = null;
        try {
            str = client.uploadStream(remoteFile, (append ? WriteMode.APPEND : WriteMode.OVERWRITE));
            byte[] buf = new byte[2048];
            int len = 0;
            while ((len = srcStream.read(buf)) >= 0) {
                str.write(buf, 0, len);
            }
            return str.getRemoteFile();
        }
        finally {
            if (str != null) str.close();
        }
    }
View Full Code Here

TOP

Related Classes of com.enterprisedt.net.ftp.FileTransferOutputStream

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.