Exemple #1
0
 protected boolean initializeUpdateSite(
     final String url, final String sshHost, final String uploadDirectory)
     throws InstantiationException {
   final FilesUploader uploader = FilesUploader.initialUpload(url, sshHost, uploadDirectory);
   Progress progress = null;
   try {
     if (!uploader.login()) return false;
     progress = getProgress("Initializing Update Site...");
     uploader.upload(progress);
     // JSch needs some time to finalize the SSH connection
     try {
       Thread.sleep(1000);
     } catch (final InterruptedException e) {
       /* ignore */
     }
     return true;
   } catch (final Canceled e) {
     if (progress != null) progress.done();
   } catch (final Throwable e) {
     UpdaterUserInterface.get().handleException(e);
     if (progress != null) progress.done();
   }
   return false;
 }