commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maurizio Cucchiara <mcucchi...@apache.org>
Subject Re: FTPClient, resume an interrupted upload?
Date Tue, 07 May 2013 10:34:07 GMT
Since the exception is probably thrown on outputStream.write method, you should:
* create a new outputStream using appendFileStream method [1].
* try to append the previously read bytesIn value

> OutputStream outputStream = ftpClient.storeFileStream(remoteFile);
>
>         // Transfer
>         while ((read = inputStream.read(bytesIn)) != -1) {
>             outputStream.write(bytesIn, 0, read);
>             transfered += read;
>         }

[1] http://commons.apache.org/proper/commons-net/apidocs/org/apache/commons/net/ftp/FTPClient.html#appendFileStream(java.lang.String)
Twitter     :http://www.twitter.com/m_cucchiara
G+          :https://plus.google.com/107903711540963855921
Linkedin    :http://www.linkedin.com/in/mauriziocucchiara
VisualizeMe: http://vizualize.me/maurizio.cucchiara?r=maurizio.cucchiara

Maurizio Cucchiara

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message