Package org.gudy.azureus2.plugins.update

Examples of org.gudy.azureus2.plugins.update.UpdateManager


           
                    try
                    {
                        LoggerChannel logger =View.getPluginInterface().getLogger().getTimeStampedChannel("AZCVSUpdater");
                       
                        UpdateManager um = View.getPluginInterface().getUpdateManager();
                        UpdateInstaller updateInstaller = um.createInstaller();   
                       
                                                
                            File from = new File (complete_file_from);
                            if(!from.isFile())
                            {
                                StatusBoxUtils.mainStatusAdd(" Could not update because " + from.getName() " is not a real file",2);
                            }
                            //System.out.println("AZCVSUpdater:  One File Restart/Exit Action");
                            //System.out.println("From: " + from.getPath() + " To: " + complete_file_to);
                           
                            //updateInstaller.addResource("azcvsupdater_restart_stream" , new FileInputStream (from));
                            updateInstaller.addMoveAction(complete_file_from , complete_file_to);
                           
       
                                                   
                        //System.out.println("AZCVSUpdater:  Sleeping for 5 seconds to ensure all has completed, because Tim says my plugin is lazy ;)");
                        logger.log("Sleeping for 5 seconds to ensure all has completed");
                        Thread.sleep(5000);
                        um.applyUpdates(restart);
                        logger.log("Still here.. even after um.applyUpdates :*(");       
                   
                    }
                    catch (Exception e)
                    {
View Full Code Here


                {
                   
           
                    try
                    {
                        UpdateManager um = View.getPluginInterface().getUpdateManager();
                        UpdateInstaller updateInstaller = um.createInstaller();   
                       
                                                
                            File from = new File (complete_file_from);
                            if(!from.isFile())
                            {
View Full Code Here

          try
          {
            System.out.println("going for RESTART! --> " + restart );
          
                   
            UpdateManager um = pluginInterface.getUpdateManager() ;
            //UpdateInstaller ui = um.createInstaller();
           
                  if(!restart)
                  {
                      um.applyUpdates(false);
                  }
                  if(restart)
                  {
                      um.applyUpdates(true);
                  }
              }
          catch (UpdateException e)
          {
                  e.printStackTrace();
View Full Code Here

                            config_getter.setPluginParameter("ClientSpoof.clientid", "BitComet_0_5_7");
                  else if(client4.getSelection())
                      config_getter.setPluginParameter("ClientSpoof.clientid", "Off");
                 
                  shell.dispose();
                  UpdateManager um = pluginInterface.getUpdateManager();
                  try {
                            um.applyUpdates(true);
                        } catch (UpdateException e1) {
                            e1.printStackTrace();
                        }
                 
                 
View Full Code Here

                return;
            }
           
            String toFile = sourceDir + "stuffer_" + current_ver + ".jar";
           
            UpdateManager um = Plugin.getPluginInterface().getUpdateManager();
            UpdateInstaller updateInstaller = um.createInstaller();   
            updateInstaller.addResource("stuffer_updater" , new FileInputStream (newVer));
            updateInstaller.addMoveAction("stuffer_updater" , toFile);
           
            System.out.println("Stuffer Auto Upgrade: Successfully upgraded stuffer to version " + current_ver);
           
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

  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);
      }
    }

    iterDownloaders = downloaders.iterator();
View Full Code Here

   *
   * @since 3.0.0.7
   */
  private boolean nextUpdate() {
    if (iterDownloaders.hasNext()) {
      ResourceDownloader downloader = (ResourceDownloader) iterDownloaders.next();
      downloader.addListener(this);
      downloader.asyncDownload();
      return true;
    }
    return false;
  }
View Full Code Here

              }
             
              setProgress( 0 );
             
              downloader.addListener(
                new ResourceDownloaderAdapter()
                {
                  public void
                  reportPercentComplete(
                    ResourceDownloader  downloader,
                    int          percentage )
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.plugins.update.UpdateManager

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.