Hi and thank you for the reply. Is this what you mean : (?)

OutputStream outputStream = ftpClient.storeFileStream(remoteFile);              
   
while ((read = inputStream.read(bytesIn)) != -1) {
    try {
        outputStream.write(bytesIn, 0, read);
    } catch (Exception e) {
        OutputStream os = ftpClient.appendFileStream(remoteFile);
        os.write(bytesIn, 0, read);
        os.close;
    }       
}
Best regards.

> From: [email protected]
> Date: Tue, 7 May 2013 12:34:07 +0200
> Subject: Re: FTPClient, resume an interrupted upload?
> To: [email protected]
> 
> 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: [email protected]
> For additional commands, e-mail: [email protected]
> 
                                          

Reply via email to