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();
}
}