Package com.aelitis.azureus.core.subs

Examples of com.aelitis.azureus.core.subs.SubscriptionException


       
        byte[]  private_key = subs.getPrivateKey();
       
        if ( private_key == null ){
         
          throw( new SubscriptionException( "Only the originator of a subscription can modify it" ));
        }
             
        map.put( "size", new Long( contents.length ));
       
        try{       
          map.put( "hash", new_hash );
          map.put( "sig", sign( private_key, new_hash, version, contents.length ));
         
        }catch( Throwable e ){
         
          throw( new SubscriptionException( "Crypto failed: " + Debug.getNestedExceptionMessage(e)));
        }
      }
     
      File  backup_file  = null;
     
      if ( file.exists()){
       
        backup_file = new File( file.getParent(), file.getName() + ".bak" );
       
        backup_file.delete();
       
        if ( !file.renameTo( backup_file )){
         
          throw( new SubscriptionException( "Backup failed" ));
        }
      }
     
      try{
        VuzeFile  vf = VuzeFileHandler.getSingleton().create();
       
        vf.addComponent( VuzeFileComponent.COMP_TYPE_SUBSCRIPTION, map );
       
        vf.write( file );
     
        hash      = new_hash;
        sig        = (byte[])map.get( "sig" );
        sig_data_size  = contents.length;
       
      }catch( Throwable e ){
       
        if ( backup_file != null ){
         
          backup_file.renameTo( file );
        }
       
        throw( new SubscriptionException( "File write failed: " + Debug.getNestedExceptionMessage(e)));
      }
    }catch( Throwable e ){
     
      rethrow( e );
    }
View Full Code Here


    if ( e instanceof SubscriptionException ){
     
      throw((SubscriptionException)e);
    }
   
    throw( new SubscriptionException( "Operation failed", e ));
  }
View Full Code Here

           
      syncToBody( body );
     
    }catch( Throwable e ){
     
      throw( new SubscriptionException( "Failed to create subscription", e ));
    }
  }
View Full Code Here

    is_public      = body.isPublic();
    singleton_details  = body.getSingletonDetails();
   
    if ( az_version > AZ_VERSION ){
     
      throw( new SubscriptionException( MessageText.getString( "subscription.version.bad", new String[]{ name })));
    }
  }
View Full Code Here

      if ( e instanceof SubscriptionException ){
       
        throw((SubscriptionException)e );
      }
     
      throw( new SubscriptionException( "Failed to read subscription", e ));
    }
  }
View Full Code Here

              failed(
                SubscriptionException    e )
              {
                if ( popularity == -1 ){
                 
                  listener.failed( new SubscriptionException( "Failed to read popularity", e ));
                 
                }else{
                 
                  listener.gotPopularity( popularity );
                }
              }
            });
         
        }catch( Throwable e ){
         
          if ( popularity == -1 ){
         
            listener.failed( new SubscriptionException( "Failed to read popularity", e ));
           
          }else{
           
            listener.gotPopularity( popularity );
          }
View Full Code Here

    try{
      return( VuzeFileHandler.getSingleton().loadVuzeFile( manager.getVuzeFile( this ).getAbsolutePath()));
     
    }catch( Throwable e ){
     
      throw( new SubscriptionException( "Failed to get Vuze file", e ));
    }
  }
View Full Code Here

         
          listener.failed( subs, e );
         
        }catch( Throwable e ){
         
          listener.failed( subs, new SubscriptionException( "Download failed", e ));
        }
      }
    }.start();
  }
View Full Code Here

TOP

Related Classes of com.aelitis.azureus.core.subs.SubscriptionException

Copyright © 2018 www.massapicom. 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.