Examples of TorrentAttribute


Examples of org.gudy.azureus2.plugins.torrent.TorrentAttribute

       
        Iterator  it = share_map.iterator();
       
        TorrentManager tm = ci.azureus_core.getPluginManager().getDefaultPluginInterface().getTorrentManager();

        TorrentAttribute  category_attribute   = tm.getAttribute( TorrentAttribute.TA_CATEGORY );
        TorrentAttribute  props_attribute   = tm.getAttribute( TorrentAttribute.TA_SHARE_PROPERTIES );
       
        while( it.hasNext()){
         
          ShareResourceDirContents  root = (ShareResourceDirContents)it.next();
         
View Full Code Here

Examples of org.gudy.azureus2.plugins.torrent.TorrentAttribute

  private void
  taTest()
  {
    try{
     
      final TorrentAttribute ta = plugin_interface.getTorrentManager().getAttribute(TorrentAttribute.TA_CATEGORY);
     
      ta.addTorrentAttributeListener(
        new TorrentAttributeListener()
        {
          public void
          event(
            TorrentAttributeEvent  ev )
          {
            System.out.println( "ev: " + ev.getType() + ", " + ev.getData());
           
            if ( ev.getType() == TorrentAttributeEvent.ET_ATTRIBUTE_VALUE_ADDED ){
             
              if ( "plop".equals( ev.getData())){
               
                ta.removeDefinedValue( "plop" );
              }
            }
          }
        });
     
      ta.addDefinedValue( "wibble" );
         
     
      plugin_interface.getDownloadManager().addListener(
        new DownloadManagerListener()
        {
View Full Code Here

Examples of org.gudy.azureus2.plugins.torrent.TorrentAttribute

        String  key = (String)keys.next();
       
        try{
          String  value = new String((byte[])attrs.get(key), Constants.DEFAULT_ENCODING );
       
          TorrentAttribute ta = TorrentManagerImpl.getSingleton().getAttribute( key );
         
          if ( ta == null ){
           
            Debug.out( "Invalid attribute '" + key );
          }else{
View Full Code Here

Examples of org.gudy.azureus2.plugins.torrent.TorrentAttribute

   
    map.put( "attributes", attrs );
   
    while( it.hasNext()){
     
      TorrentAttribute  ta = (TorrentAttribute)it.next();
     
      String  value = (String)attributes.get(ta);
     
      try{
        if ( value != null ){
         
          attrs.put( ta.getName(), value.getBytes( Constants.DEFAULT_ENCODING ));
         
        }
      }catch( Throwable e ){
       
        Debug.printStackTrace(e);
View Full Code Here

Examples of org.gudy.azureus2.plugins.torrent.TorrentAttribute

      boolean  private_torrent = COConfigurationManager.getBooleanParameter( "Sharing Torrent Private" );
     
      boolean  dht_backup_enabled = COConfigurationManager.getBooleanParameter( "Sharing Permit DHT" );

      TorrentAttribute ta_props = TorrentManagerImpl.getSingleton().getAttribute( TorrentAttribute.TA_SHARE_PROPERTIES );
     
      String  props = getAttribute( ta_props );
     
      if ( props != null ){
     
View Full Code Here

Examples of org.gudy.azureus2.plugins.torrent.TorrentAttribute

   
    for (int i=0;i<factories.length;i++){


      String attributeID = "no-ext-seeds-" + factories[i].getClass().getSimpleName();
      TorrentAttribute attribute = plugin_interface.getTorrentManager().getPluginAttribute( attributeID );

      boolean noExternalSeeds = download.getBooleanAttribute(attribute);
      if (noExternalSeeds) {
        continue;   
      }
View Full Code Here

Examples of org.gudy.azureus2.plugins.torrent.TorrentAttribute

    if ( torrent != null ){
           
      for (int i=0;i<factories.length;i++){
       
        String attributeID = "no-ext-seeds-" + factories[i].getClass().getSimpleName();
        TorrentAttribute attribute = plugin_interface.getTorrentManager().getPluginAttribute( attributeID );

        ExternalSeedReader[]  x = factories[i].getSeedReaders( this, download, config );
       
        download.setBooleanAttribute(attribute, x.length == 0);
       
View Full Code Here

Examples of org.gudy.azureus2.plugins.torrent.TorrentAttribute

     
      String  name = (String)event.getData();
     
      List  property_listeners_ref = property_listeners;
     
      final TorrentAttribute  attr = convertAttribute( name );
     
      if ( attr != null ){
       
        for (int i=0;i<property_listeners_ref.size();i++){
         
View Full Code Here

Examples of org.gudy.azureus2.plugins.torrent.TorrentAttribute

  }
 
  public void attributeEventOccurred(DownloadManager download, String attribute, int event_type) {
    CopyOnWriteMap attr_listener_map = getAttributeMapForType(event_type);

    TorrentAttribute attr = convertAttribute(attribute);
    if (attr == null) {return;}
   
    List listeners = null;
    listeners = ((CopyOnWriteList)attr_listener_map.get(attribute)).getList();
View Full Code Here

Examples of org.gudy.azureus2.plugins.torrent.TorrentAttribute

    }

    public static String[] getExistingCategories(PluginInterface pluginInterface) {
        List<String> categories = new ArrayList<String>();
        Download[] torrents = pluginInterface.getDownloadManager().getDownloads();
        TorrentAttribute ta = TorrentUtils.getCategoryAttr(pluginInterface);
        for (Download torrent : torrents) {
            String category = torrent.getAttribute(ta);
            if (category == null)
                continue;
            if (!TorrentUtils.hasMovieFile(torrent))
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.