if ( responseCode != 0 )
{
String errorMessage = root
.getFirstChildElement( "ErrorMessage" )
.getValue( );
throw new NirvanixException( responseCode, errorMessage );
}
// Reached the end, reset retry attempts.
retrycount = 0;
retry = false;
_progressTotal += totalThisFile;
// urlConn.disconnect();
}
catch ( java.net.SocketTimeoutException socketTimeout )
{
// Go back to top of loop with new totalThisFile and retry
// flag set.
totalThisFile -= bytesRead;
_bytesUploaded -= bytesRead;
retry = true;
// if we reach the maximum raise it as a retry exception.
if ( retrycount++ > MAXRETRYATTEMPTS )
{
throw new RetryException( socketTimeout );
}
// Delay for a second on a read timeout if we are not at
// max_retries
Thread.sleep( this.RETRY_WAIT_SOCKET_READ_TIMEOUT );
}
catch ( java.net.SocketException socketEx )
{
// Go back to top of loop with new totalThisFile and retry
// flag set.
totalThisFile -= bytesRead;
_bytesUploaded -= bytesRead;
retry = true;
// if we reach the maximum raise it as a retry exception.
if ( retrycount++ > MAXRETRYATTEMPTS )
{
throw new RetryException( socketEx );
}
// Delay for a second on a read timeout if we are not at
// max_retries
Thread.sleep( this.RETRY_WAIT_SOCKET_READ_TIMEOUT );
}
catch ( Exception ex )
{
// There was a failure while transmitting, send out a retry
// exception, the user should be responsible for catching
// these
// and handling them appropriately by resending the entire
// file.
// Later this will be replaced by block level retry.
// Go back to top of loop with new totalThisFile and retry
// flag set.
totalThisFile -= bytesRead;
_bytesUploaded -= bytesRead;
retry = true;
// if we reach the maximum raise it as a retry exception.
if ( retrycount++ > MAXRETRYATTEMPTS )
{
throw new RetryException( ex );
}
}
}
}
catch ( Exception ex )
{
throw new NirvanixException( -1, ex.toString( ) );
}
finally
{
try
{