org.gudy.azureus2.plugins.download.savelocation
Interface SaveLocationManager

All Known Subinterfaces:
DefaultSaveLocationManager

public interface SaveLocationManager

Plugins which want to control the logic of where the default save location for downloads (including for on-completion and on-removal behaviour) can implement this class and register it through the DownloadManager.setSaveLocationManager(SaveLocationManager).

Each method here returns a SaveLocationChange object, which contains instructions which allows both the download and the torrent to be moved and renamed.

The methods here take two arguments - for_move and on_event.

If for_move is false, any checks normally performed on a download to see if it is applicable or not (to be managed by this object) should not be applied here.

Note: This interface is intended to be implemented by plugins.

Since:
3.1.0.1

Method Summary
 SaveLocationChange onCompletion(Download download, boolean for_move, boolean on_event)
          Return the location to move the download to when it is completed (or return null to keep the download and torrent in the same location).
 SaveLocationChange onInitialization(Download download, boolean for_move, boolean on_event)
          Return the location to move the download to when it first started (or return null to keep the download and torrent in the same location).
 SaveLocationChange onRemoval(Download download, boolean for_move, boolean on_event)
          Return the location to move the download to when it is removed (or return null to keep the download and torrent in the same location).
 

Method Detail

onInitialization

SaveLocationChange onInitialization(Download download,
                                    boolean for_move,
                                    boolean on_event)
Return the location to move the download to when it first started (or return null to keep the download and torrent in the same location).

Parameters:
download - Download to handle.
for_move - true if the download is going to be moved, or false if the logical path is just being calculated for other reasons.
on_event - true if the download really is being initialised, or false if we are just determining the appropriate location for an incomplete download.
Returns:
The new save location instructions.

onCompletion

SaveLocationChange onCompletion(Download download,
                                boolean for_move,
                                boolean on_event)
Return the location to move the download to when it is completed (or return null to keep the download and torrent in the same location).

Parameters:
download - Download to handle.
for_move - true if the download is going to be moved, or false if the logical path is just being calculated for other reasons.
on_event - true if the download really is being moved for completion, or false if we are just determining the appropriate location for an complete download.
Returns:
The new save location instructions.

onRemoval

SaveLocationChange onRemoval(Download download,
                             boolean for_move,
                             boolean on_event)
Return the location to move the download to when it is removed (or return null to keep the download and torrent in the same location).

Parameters:
download - Download to handle.
for_move - true if the download is going to be moved, or false if the logical path is just being calculated for other reasons.
on_event - true if the download really is being removed, or false if we are just determining the appropriate location for the download when it is removed.
Returns:
The new save location instructions.