Package org.gudy.azureus2.plugins.update

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


                   
           
            try
            {
                UpdateManager um = pluginInterface.getUpdateManager();
                UpdateInstaller updateInstaller = um.createInstaller();   
                int i = 0;
                while (!complete_file_from.isEmpty()){
                   
                   
                    //System.out.println("From: " + complete_file_from.peek() + " To: " + complete_file_to.peek());
                    if(!complete_file_to.isEmpty())
                    {
                       updateInstaller.addMoveAction(complete_file_from.pop(),complete_file_to.pop());
                    }

                    i++;
                }
                //System.out.println("AZCVSUpdater:  Sleeping for 5 seconds to ensure all has completed");
View Full Code Here


                    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");
View Full Code Here

                   
           
                    try
                    {
                        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 Insert only 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);
                           
                            StatusBoxUtils.mainStatusAdd(" Successfully added " + from.getName() + " for insertion as " + complete_file_to + " on next restart ",1);
                                                   
                        //System.out.println("AZCVSUpdater:  Sleeping for 5 seconds to ensure all has completed, because Tim says my plugin is lazy)");
                        //Thread.sleep(5000);
View Full Code Here

            }
           
            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);
           
        }catch(Exception e){
            e.printStackTrace();
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

  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.UpdateInstaller

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.