Examples of NirvanixException


Examples of com.nirvanix.sdk.session.NirvanixException

        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
      {
View Full Code Here

Examples of com.nirvanix.sdk.session.NirvanixException

               NirvanixAPICommands.GET_PATH_INFO,
               parms );
 
  if ( response == null )
  { // This should never happen. Paranoia check.
      throw new NirvanixException( -1,
        "Received a 'null' valued response from command '" +
        NirvanixAPICommands.GET_PATH_INFO.getClass( ) + "'." );
  }
 
  PathInfoResponse parsed = new PathInfoResponse( response );
View Full Code Here

Examples of com.nirvanix.sdk.session.NirvanixException

  }
 
  if ( response == null )
  {
      // This should never happen. Paranoia check.
      throw new NirvanixException( -1,
        "Received a 'null' valued response from command '"
        + NirvanixAPICommands.GET_PATH_INFO.getClass( )
        + "'." );
  }
 
  // Need to parse the response to determine if object is file or dir.
  // TODO: Use xsd to check schema?
  Elements pathInfoElements = response.getChildElements( "GetPathInfo" );
  if ( pathInfoElements == null || pathInfoElements.size( ) != 1 )
  {
      // This should never happen. Paranoia check.
      throw new NirvanixException(
        -1,
        "Error parsing Nirvanix command response. Expected one 'GetPathInfo' elements in response but receieved "
          + pathInfoElements == null ? "(null)"
          : pathInfoElements.size( ) + " instead." );
  }
 
  Elements isFileElements = pathInfoElements.get( 0 )
    .getChildElements( "IsFile" );
  if ( isFileElements == null || isFileElements.size( ) != 1 )
  {
      // This should never happen. Paranoia check.
      throw new NirvanixException(
        -1,
        "Error parsing Nirvanix command response. Expected one 'IsFile' elements in response but receieved "
          + isFileElements == null ? "(null)"
          : isFileElements.size( ) + " instead." );
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.