Package org.gudy.azureus2.plugins.utils.resourcedownloader

Examples of org.gudy.azureus2.plugins.utils.resourcedownloader.ResourceDownloader


      // slip the non-standard "plugins" initialisation inbetween the internal ones
      // and the plugin ones so plugin ones can be children of it
     
      boolean  plugin_section = i >= internalSections.length;
     
      ConfigSection section = pluginSections.get(i);
     
      if (section instanceof ConfigSectionSWT || section instanceof UISWTConfigSection ) {
        String name;
        try {
          name = section.configSectionGetName();
         } catch (Exception e) {
           Logger.log(new LogEvent(LOGID, "A ConfigSection plugin caused an "
              + "error while trying to call its "
              + "configSectionGetName function", e));
          name = "Bad Plugin";
        }

         String  section_key = name;
        
         if ( plugin_section ){
             // if resource exists without prefix then use it as plugins don't
             // need to start with the prefix
          
           if ( !MessageText.keyExists(section_key)){
            
             section_key = sSectionPrefix + name;
           }
          
         }else{
          
           section_key = sSectionPrefix + name;
         }
        
         String  section_name = MessageText.getString( section_key );
        
         try {
          TreeItem treeItem;
          String location = section.configSectionGetParentSection();
 
          if ( location.length() == 0 || location.equalsIgnoreCase(ConfigSection.SECTION_ROOT)){
            //int position = findInsertPointFor(section_name, tree);
            //if ( position == -1 ){
              treeItem = new TreeItem(tree, SWT.NULL);
View Full Code Here


  private void ensureSectionBuilt(TreeItem treeSection, boolean recreateIfAlreadyThere) {
    ScrolledComposite item = (ScrolledComposite)treeSection.getData("Panel");

    if (item != null) {
     
      ConfigSection configSection = (ConfigSection)treeSection.getData("ConfigSectionSWT");
     
      if (configSection != null) {
       
        Control previous = item.getContent();
        if (previous instanceof Composite) {
          if (!recreateIfAlreadyThere) {
            return;
          }
          configSection.configSectionDelete();
          sectionsCreated.remove(configSection);     
          Utils.disposeComposite((Composite)previous,true);
        }
       
        Composite c;
View Full Code Here

   
    int userMode = COConfigurationManager.getIntParameter("User Mode");
    int maxUsermode = 0;
    try
    {
      ConfigSection sect = sections.get(section);
      if (sect instanceof UISWTConfigSection)
      {
        maxUsermode = ((UISWTConfigSection) sect).maxUserMode();
      }
    } catch (Error e)
View Full Code Here

   
    for (int i=0;i<items.length;i++){
     
      TreeItem  item = items[i];
             
      ConfigSection section = (ConfigSection)item.getData("ConfigSectionSWT");
       
      if ( section != null && section.getClass() == config_section_class ){
         
        tree.setSelection( new TreeItem[]{ item });
       
        showSection( item );
       
View Full Code Here

    start();
  }

  private void start() {
    for (int i = 0; i < updates.length; i++) {
      Update update = updates[i];
      ResourceDownloader[] rds = update.getDownloaders();
      for (int j = 0; j < rds.length; j++) {
        ResourceDownloader rd = rds[j];
        downloaders.add(rd);
      }
    }
View Full Code Here

  private void allDownloadsComplete() {
    boolean bRequiresRestart = false;
    boolean bHadMandatoryUpdates = false;
   
    for (int i = 0; i < updates.length; i++) {
      Update update = updates[i];
        // updates with no downloaders exist for admin purposes only
      if ( update.getDownloaders().length > 0){
        if (update.getRestartRequired() != Update.RESTART_REQUIRED_NO) {
          bRequiresRestart = true;
        }
        if ( update.isMandatory()){
          bHadMandatoryUpdates = true;
        }
      }
    }
View Full Code Here

          handleEvent(Event event)
          {
            try{
              PluginInterface pi = AzureusCoreFactory.getSingleton().getPluginManager().getDefaultPluginInterface();
             
              UpdateInstaller installer = pi.getUpdateManager().createInstaller();
           
              installer.addMoveAction(
                "C:\\temp\\file1", "C:\\temp\\file2" );
           
              installer.installNow(
                new UpdateInstallerListener()
                {
                  public void
                  reportProgress(
                    String    str )
View Full Code Here

           
              installer.addMoveAction(
                "C:\\temp\\file1", "C:\\temp\\file2" );
           
              installer.installNow(
                new UpdateInstallerListener()
                {
                  public void
                  reportProgress(
                    String    str )
                  {
View Full Code Here

          public void perform(TimerEvent ev) {
            performAutoCheck(false);
          }
        });

    DelayedTask delayed_task =
      UtilitiesImpl.addDelayedTask(
        "Update Check",
        new Runnable()
        {
          public void
          run()
          {
            // check for non-writeable app dir on non-vista platforms (vista we've got a chance of
            // elevating perms when updating) and warn user. Particularly useful on OSX when
            // users haven't installed properly
   
            if ( !( Constants.isWindowsVistaOrHigher || SystemProperties.isJavaWebStartInstance())){
   
              String  app_str = SystemProperties.getApplicationPath();
   
              if ( !new File(app_str).canWrite()){
   
                final UIFunctions uiFunctions = UIFunctionsManager.getUIFunctions();
   
                if ( uiFunctions != null ){
   
                  if ( app_str.endsWith( File.separator )){
   
                    app_str = app_str.substring(0, app_str.length()-1);
                  }
                 
                  final String f_app_str = app_str;
                 
                  Utils.execSWTThread(
                    new Runnable()
                    {
                      public void
                      run()
                      {
                        UIFunctionsUserPrompter prompt =
                          uiFunctions.getUserPrompter(
                            MessageText.getString("updater.cant.write.to.app.title"),
                            MessageText.getString("updater.cant.write.to.app.details", new String[]{f_app_str}),
                            new String[]{ MessageText.getString( "Button.ok" )},
                            0 );
       
                        //prompt.setHtml( "http://a.b.c/" );
         
                        prompt.setIconResource( "warning" );
         
                        prompt.setRemember( "UpdateMonitor.can.not.write.to.app.dir.2", false,
                            MessageText.getString( "MessageBoxWindow.nomoreprompting" ));
         
                        prompt.open(null);
                      }
                    },
                    true );
                }
              }
            }
   
            performAutoCheck(true);
          }
        });
   
    delayed_task.queue();
  }
View Full Code Here

  {
    boolean  handled = false;
   
    for (int i=0;i<listeners.size();i++){
     
      PooledByteBuffer  buffer = new PooledByteBufferImpl(message.getPayload());
     
      try{
        ((GenericMessageConnectionListener)listeners.get(i)).receive( this, buffer );
       
        handled = true;
       
      }catch( Throwable f ){
       
        buffer.returnToPool();
       
        if ( !( f instanceof MessageException )){
       
          Debug.printStackTrace(f);
        }
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.plugins.utils.resourcedownloader.ResourceDownloader

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.