Examples of SaveLocationChange


Examples of org.gudy.azureus2.plugins.download.savelocation.SaveLocationChange

    if (dm.getDownloadState().getFlag(DownloadManagerState.FLAG_MOVE_ON_COMPLETION_DONE)) {
      logInfo("Completion flag already set on " + describe(dm) + ", skip move-on-completion behaviour.", dm);
      return null;
    }
   
    SaveLocationChange sc;
    try {sc = CURRENT_HANDLER.onCompletion(PluginCoreUtils.wrap(dm), true, true);}
    catch (Exception e) {
      logError("Error trying to determine on-completion location.", dm, e);
      return null;
    }
View Full Code Here

Examples of org.gudy.azureus2.plugins.download.savelocation.SaveLocationChange

    return COConfigurationManager.getBooleanParameter("File.move.download.removed.enabled");
  }
 
  public static SaveLocationChange recalculatePath(DownloadManager dm) {
    Download download = PluginCoreUtils.wrap(dm);
    SaveLocationChange result = null;
    if (canGoToCompleteDir(dm)) {
      result = CURRENT_HANDLER.onCompletion(download, true, false);
    }
    if (result == null) {
      result = CURRENT_HANDLER.onInitialization(download, true, false);
View Full Code Here

Examples of org.gudy.azureus2.plugins.download.savelocation.SaveLocationChange

    public SaveLocationChange getTransferDetails(DownloadManager dm,
        ContextDescriptor cd, File target_path) {
     
      if (target_path == null) {throw new NullPointerException();}

      SaveLocationChange result = new SaveLocationChange();
      result.download_location = target_path;
      if (this.getBoolean("torrent")) {
        result.torrent_location = target_path;
      }
      return result;
View Full Code Here

Examples of org.gudy.azureus2.plugins.download.savelocation.SaveLocationChange

        if (!alreadyMoved && !download_manager.isDataAlreadyAllocated()) {
         
          // Check the files don't already exist in their current location.
          if (!files_exist) {files_exist = this.filesExist();}
          if (!files_exist) {
            SaveLocationChange transfer =
              DownloadManagerMoveHandler.onInitialisation(download_manager);
            if (transfer != null) {
              if (transfer.download_location != null || transfer.download_name != null) {
                File dl_location = transfer.download_location;
                if (dl_location == null) {dl_location = download_manager.getAbsoluteSaveLocation().getParentFile();}
View Full Code Here

Examples of org.gudy.azureus2.plugins.download.savelocation.SaveLocationChange

        if (ending) {
            if (this.alreadyMoved) {return false;}
            this.alreadyMoved = true;
        }

        SaveLocationChange move_details;
        if (removing) {
          move_details = DownloadManagerMoveHandler.onRemoval(this.download_manager);
         
        }else{
          DownloadManagerMoveHandler.onCompletion(
View Full Code Here

Examples of org.gudy.azureus2.plugins.download.savelocation.SaveLocationChange

      }
    }
   
    public void moveDataFiles(File new_parent_dir, String new_name) {
      SaveLocationChange loc_change = new SaveLocationChange();
      loc_change.download_location = new_parent_dir;
      loc_change.download_name = new_name;
      moveFiles(loc_change, false);
    }
View Full Code Here

Examples of org.gudy.azureus2.plugins.download.savelocation.SaveLocationChange

     * unnecessarily pausing a running torrent (it fires off listeners, which
     * might try to move the download).
     *
     * This helps us avoid a situation with AzCatDest...
     */
    SaveLocationChange slc = new SaveLocationChange();
    slc.download_location = destination;
    slc.download_name = new_name;
   
    File current_location = getSaveLocation();
    if (slc.normaliseDownloadLocation(current_location).equals(current_location)) {
      return;
    }
   
    try{
      FileUtil.runAsTask(
View Full Code Here

Examples of org.gudy.azureus2.plugins.download.savelocation.SaveLocationChange

  public void moveTorrentFile(File new_parent_dir) throws DownloadManagerException {
    this.moveTorrentFile(new_parent_dir, null);
  }

  public void moveTorrentFile(File new_parent_dir, String new_name) throws DownloadManagerException {
    SaveLocationChange slc = new SaveLocationChange();
    slc.torrent_location = new_parent_dir;
    slc.torrent_name = new_name;
   
    File torrent_file_now = new File(getTorrentFileName());
    if (!slc.isDifferentTorrentLocation(torrent_file_now)) {return;}

    boolean is_paused = this.pause();
    try {moveTorrentFile0(new_parent_dir, new_name);}
    finally {if (is_paused) {this.resume();}}
  }
View Full Code Here

Examples of org.gudy.azureus2.plugins.download.savelocation.SaveLocationChange

          if (dm != null) {
            dm.downloadRemoved();
            return;
          }
               
          SaveLocationChange move_details;
          move_details = DownloadManagerMoveHandler.onRemoval(this);
          if (move_details == null) {
            return;
          }
         
          boolean can_move_torrent = move_details.hasTorrentChange();
         
          try {
            if (move_details.hasDownloadChange()) {
              this.moveDataFiles(move_details.download_location, move_details.download_name);
            }
          }
          catch (Exception e) {
            can_move_torrent = false;
View Full Code Here

Examples of org.gudy.azureus2.plugins.download.savelocation.SaveLocationChange

   
    /**
     * @deprecated
     */
    public File[] calculateDefaultPaths(boolean for_moving) {
      SaveLocationChange slc = this.calculateDefaultDownloadLocation();
    if (slc == null) {return null;}
    return new File[] {slc.download_location, slc.torrent_location};
    }
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.