Package com.biglybt.core.torrent.impl
Class TorrentOpenOptions
- java.lang.Object
-
- com.biglybt.core.torrent.impl.TorrentOpenOptions
-
public class TorrentOpenOptions extends java.lang.Object
Class to store one Torrent file's info. Used to populate table and store user's choices.This was copied out of the UI code, and still contains some crap code
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
TorrentOpenOptions.FileListener
static interface
TorrentOpenOptions.ParentDirChangedListener
-
Field Summary
Fields Modifier and Type Field Description private boolean
autoTaggingApplied
private java.util.Set<Tag>
autoTags
private boolean
bDeleteFileOnCancel
private boolean
bDeleteFileOnCancelSet
private boolean
bSequentialDownload
static int
CA_ACCEPT
static int
CA_NONE
static int
CA_REJECT
private boolean
cancelDisabled
private int
complete_action
private boolean
dirty
boolean
disableIPFilter
private java.util.Map<java.lang.String,java.lang.Boolean>
enabledNetworks
private boolean
explicitDataDir
private CopyOnWriteList<TorrentOpenOptions.FileListener>
fileListeners
private TorrentOpenFileOptions[]
files
private boolean
hide_errors
private java.util.Map<java.lang.Integer,java.io.File>
initial_linkage_map
private java.util.Map<java.lang.String,java.lang.Object>
initialMetadata
private java.util.List<Tag>
initialTags
private int
iQueueLocation
private int
iStartID
boolean
isValid
private java.lang.String
manualRename
private int
max_down
private int
max_up
private java.io.File
move_on_complete
private static java.lang.String
PARAM_DEFSAVEPATH
private static java.lang.String
PARAM_MOVEWHENDONE
private static java.lang.String
PARAM_QUEUEPOSITION
java.util.Map<java.lang.String,java.lang.Boolean>
peerSource
static int
QUEUELOCATION_BOTTOM
static int
QUEUELOCATION_TOP
private boolean
removedTopLevel
private java.lang.String
sDestDir
private java.lang.String
sDestSubDir
private java.lang.String
sFileName
java.lang.String
sOriginatingLocation
static int
STARTMODE_ALLOCATED_AND_PAUSED
static int
STARTMODE_ALLOCATED_AND_STOPPED
static int
STARTMODE_FORCESTARTED
static java.lang.String[]
STARTMODE_KEYS
static int
STARTMODE_PAUSED
static int
STARTMODE_QUEUED
static int
STARTMODE_SEEDING
static int
STARTMODE_STOPPED
static int[]
STARTMODE_VALUES
private TOTorrent
torrent
private long
totalSize
private java.util.List<java.util.List<java.lang.String>>
updatedTrackers
private java.lang.String
userComment
-
Constructor Summary
Constructors Modifier Constructor Description private
TorrentOpenOptions(TorrentOpenOptions toBeCloned)
clones everything except files and torrentTorrentOpenOptions(java.lang.String sFileName, TOTorrent torrent, boolean bDeleteFileOnCancel, java.util.Map<java.lang.String,java.lang.Object> options)
InitTorrentOpenOptions(java.util.Map<java.lang.String,java.lang.Object> options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(TorrentOpenOptions.FileListener l)
static void
addModeDuringCreate(int startMode, DownloadManager dm)
static void
addModePostCreate(int startMode, DownloadManager dm)
static int
addModePreCreate(int startMode)
boolean
addToDownloadManager()
boolean
allFilesExist()
boolean
allFilesMoving()
void
applyAutoTagging()
void
applySkipConfig()
void
cancel()
boolean
canDeselectTag(Tag tag)
void
deleteTorrent()
void
fileDownloadStateChanged(TorrentOpenFileOptions torrentOpenFileOptions, boolean toDownload)
void
filePriorityStateChanged(TorrentOpenFileOptions torrentOpenFileOptions, int priority)
boolean
getAndClearDirt()
TorrentOpenOptions
getClone()
int
getCompleteAction()
java.lang.String
getDataDir()
static int
getDefaultStartMode()
java.lang.String
getDisplayName()
java.util.Map<java.lang.String,java.lang.Boolean>
getEnabledNetworks()
TorrentOpenFileOptions[]
getFiles()
boolean
getHideErrors()
java.io.File
getInitialLinkage(int index)
java.util.Map<java.lang.String,java.lang.Object>
getInitialMetadata()
java.util.List<Tag>
getInitialTags()
java.lang.String
getManualRename()
int
getMaxDownloadSpeed()
int
getMaxUploadSpeed()
java.io.File
getMoveOnComplete()
java.lang.String
getParentDir()
int
getQueueLocation()
boolean
getSequentialDownload()
private java.lang.String
getSmartDestDir()
int
getStartMode()
java.lang.String
getSubDir()
TOTorrent
getTorrent()
java.lang.String
getTorrentFile()
java.lang.String
getTorrentName()
long
getTotalSize()
java.util.List<java.util.List<java.lang.String>>
getTrackers(boolean if_updated)
java.lang.String
getUserComment()
void
initialTagsChanged()
boolean
isExplicitDataDir()
boolean
isRemovedTopLevel()
boolean
isSimpleTorrent()
boolean
okToDisableAll()
void
parentDirChanged()
void
rebuildOriginalNames()
void
removeListener(TorrentOpenOptions.FileListener l)
void
renameDuplicates()
void
setCancelDisabled(boolean b)
void
setCompleteAction(int ca)
void
setDeleteFileOnCancel(boolean b)
void
setDirty()
void
setExplicitDataDir(java.lang.String parent_dir, java.lang.String sub_dir, boolean _removedTopLevel)
void
setHideErrors(boolean h)
void
setInitialTags(java.util.List<Tag> tags)
void
setManualRename(java.lang.String manualRename)
void
setMaxDownloadSpeed(int kbs)
void
setMaxUploadSpeed(int kbs)
void
setMoveOnComplete(java.io.File f)
void
setNetworkEnabled(java.lang.String net, boolean enabled)
void
setParentDir(java.lang.String parentDir)
void
setQueueLocation(int l)
void
setSequentialDownload(boolean b)
void
setStartMode(int m)
void
setTorrent(TOTorrent torrent)
void
setTorrentFile(java.lang.String str)
void
setTrackers(java.util.List<java.util.List<java.lang.String>> trackers)
void
setUserComment(java.lang.String str)
void
startOptionsChanged()
-
-
-
Field Detail
-
PARAM_DEFSAVEPATH
private static final java.lang.String PARAM_DEFSAVEPATH
- See Also:
- Constant Field Values
-
PARAM_MOVEWHENDONE
private static final java.lang.String PARAM_MOVEWHENDONE
- See Also:
- Constant Field Values
-
PARAM_QUEUEPOSITION
private static final java.lang.String PARAM_QUEUEPOSITION
- See Also:
- Constant Field Values
-
QUEUELOCATION_BOTTOM
public static final int QUEUELOCATION_BOTTOM
- See Also:
- Constant Field Values
-
QUEUELOCATION_TOP
public static final int QUEUELOCATION_TOP
- See Also:
- Constant Field Values
-
STARTMODE_KEYS
public static final java.lang.String[] STARTMODE_KEYS
-
STARTMODE_QUEUED
public static final int STARTMODE_QUEUED
- See Also:
- Constant Field Values
-
STARTMODE_STOPPED
public static final int STARTMODE_STOPPED
- See Also:
- Constant Field Values
-
STARTMODE_PAUSED
public static final int STARTMODE_PAUSED
- See Also:
- Constant Field Values
-
STARTMODE_FORCESTARTED
public static final int STARTMODE_FORCESTARTED
- See Also:
- Constant Field Values
-
STARTMODE_SEEDING
public static final int STARTMODE_SEEDING
- See Also:
- Constant Field Values
-
STARTMODE_ALLOCATED_AND_STOPPED
public static final int STARTMODE_ALLOCATED_AND_STOPPED
- See Also:
- Constant Field Values
-
STARTMODE_ALLOCATED_AND_PAUSED
public static final int STARTMODE_ALLOCATED_AND_PAUSED
- See Also:
- Constant Field Values
-
STARTMODE_VALUES
public static final int[] STARTMODE_VALUES
-
sOriginatingLocation
public java.lang.String sOriginatingLocation
-
sFileName
private java.lang.String sFileName
-
sDestDir
private java.lang.String sDestDir
-
manualRename
private java.lang.String manualRename
-
sDestSubDir
private java.lang.String sDestSubDir
-
explicitDataDir
private boolean explicitDataDir
-
removedTopLevel
private boolean removedTopLevel
-
torrent
private TOTorrent torrent
-
totalSize
private long totalSize
-
iStartID
private int iStartID
-
iQueueLocation
private int iQueueLocation
-
bSequentialDownload
private boolean bSequentialDownload
-
isValid
public boolean isValid
-
cancelDisabled
private volatile boolean cancelDisabled
-
bDeleteFileOnCancel
private boolean bDeleteFileOnCancel
-
bDeleteFileOnCancelSet
private boolean bDeleteFileOnCancelSet
-
files
private TorrentOpenFileOptions[] files
-
disableIPFilter
public boolean disableIPFilter
-
initial_linkage_map
private java.util.Map<java.lang.Integer,java.io.File> initial_linkage_map
-
fileListeners
private final CopyOnWriteList<TorrentOpenOptions.FileListener> fileListeners
-
peerSource
public java.util.Map<java.lang.String,java.lang.Boolean> peerSource
-
enabledNetworks
private java.util.Map<java.lang.String,java.lang.Boolean> enabledNetworks
-
userComment
private java.lang.String userComment
-
initialTags
private java.util.List<Tag> initialTags
-
autoTags
private java.util.Set<Tag> autoTags
-
autoTaggingApplied
private boolean autoTaggingApplied
-
initialMetadata
private java.util.Map<java.lang.String,java.lang.Object> initialMetadata
-
updatedTrackers
private java.util.List<java.util.List<java.lang.String>> updatedTrackers
-
max_up
private int max_up
-
max_down
private int max_down
-
move_on_complete
private java.io.File move_on_complete
-
hide_errors
private boolean hide_errors
-
CA_NONE
public static final int CA_NONE
- See Also:
- Constant Field Values
-
CA_ACCEPT
public static final int CA_ACCEPT
- See Also:
- Constant Field Values
-
CA_REJECT
public static final int CA_REJECT
- See Also:
- Constant Field Values
-
complete_action
private int complete_action
-
dirty
private boolean dirty
-
-
Constructor Detail
-
TorrentOpenOptions
public TorrentOpenOptions(java.lang.String sFileName, TOTorrent torrent, boolean bDeleteFileOnCancel, java.util.Map<java.lang.String,java.lang.Object> options)
Init- Parameters:
sFileName
-torrent
-bDeleteFileOnCancel
-
-
TorrentOpenOptions
public TorrentOpenOptions(java.util.Map<java.lang.String,java.lang.Object> options)
-
TorrentOpenOptions
private TorrentOpenOptions(TorrentOpenOptions toBeCloned)
clones everything except files and torrent- Parameters:
toBeCloned
-
-
-
Method Detail
-
getClone
public TorrentOpenOptions getClone()
-
getDefaultStartMode
public static int getDefaultStartMode()
-
getInitialLinkage
public java.io.File getInitialLinkage(int index)
-
getParentDir
public java.lang.String getParentDir()
-
setParentDir
public void setParentDir(java.lang.String parentDir)
-
setManualRename
public void setManualRename(java.lang.String manualRename)
-
getManualRename
public java.lang.String getManualRename()
-
setDeleteFileOnCancel
public void setDeleteFileOnCancel(boolean b)
-
deleteTorrent
public void deleteTorrent()
-
getSubDir
public java.lang.String getSubDir()
-
setExplicitDataDir
public void setExplicitDataDir(java.lang.String parent_dir, java.lang.String sub_dir, boolean _removedTopLevel)
-
isExplicitDataDir
public boolean isExplicitDataDir()
-
isRemovedTopLevel
public boolean isRemovedTopLevel()
-
isSimpleTorrent
public boolean isSimpleTorrent()
-
getStartMode
public int getStartMode()
-
setStartMode
public void setStartMode(int m)
-
getQueueLocation
public int getQueueLocation()
-
setQueueLocation
public void setQueueLocation(int l)
-
getSequentialDownload
public boolean getSequentialDownload()
-
setSequentialDownload
public void setSequentialDownload(boolean b)
-
getEnabledNetworks
public java.util.Map<java.lang.String,java.lang.Boolean> getEnabledNetworks()
-
setNetworkEnabled
public void setNetworkEnabled(java.lang.String net, boolean enabled)
-
getUserComment
public java.lang.String getUserComment()
-
setUserComment
public void setUserComment(java.lang.String str)
-
getDataDir
public java.lang.String getDataDir()
-
getSmartDestDir
private java.lang.String getSmartDestDir()
-
getInitialTags
public java.util.List<Tag> getInitialTags()
-
setInitialTags
public void setInitialTags(java.util.List<Tag> tags)
-
getInitialMetadata
public java.util.Map<java.lang.String,java.lang.Object> getInitialMetadata()
-
setDirty
public void setDirty()
-
getAndClearDirt
public boolean getAndClearDirt()
-
getTrackers
public java.util.List<java.util.List<java.lang.String>> getTrackers(boolean if_updated)
-
setTrackers
public void setTrackers(java.util.List<java.util.List<java.lang.String>> trackers)
-
setMaxUploadSpeed
public void setMaxUploadSpeed(int kbs)
-
getMaxUploadSpeed
public int getMaxUploadSpeed()
-
setMaxDownloadSpeed
public void setMaxDownloadSpeed(int kbs)
-
getMaxDownloadSpeed
public int getMaxDownloadSpeed()
-
getMoveOnComplete
public java.io.File getMoveOnComplete()
-
setMoveOnComplete
public void setMoveOnComplete(java.io.File f)
-
setHideErrors
public void setHideErrors(boolean h)
-
getHideErrors
public boolean getHideErrors()
-
getFiles
public TorrentOpenFileOptions[] getFiles()
-
rebuildOriginalNames
public void rebuildOriginalNames()
-
applySkipConfig
public void applySkipConfig()
-
canDeselectTag
public boolean canDeselectTag(Tag tag)
-
applyAutoTagging
public void applyAutoTagging()
-
getTotalSize
public long getTotalSize()
-
getTorrentName
public java.lang.String getTorrentName()
-
getDisplayName
public java.lang.String getDisplayName()
-
allFilesMoving
public boolean allFilesMoving()
-
allFilesExist
public boolean allFilesExist()
-
renameDuplicates
public void renameDuplicates()
-
okToDisableAll
public boolean okToDisableAll()
-
getTorrentFile
public java.lang.String getTorrentFile()
-
setTorrentFile
public void setTorrentFile(java.lang.String str)
-
getTorrent
public TOTorrent getTorrent()
-
setTorrent
public void setTorrent(TOTorrent torrent)
-
addListener
public void addListener(TorrentOpenOptions.FileListener l)
-
removeListener
public void removeListener(TorrentOpenOptions.FileListener l)
-
fileDownloadStateChanged
public void fileDownloadStateChanged(TorrentOpenFileOptions torrentOpenFileOptions, boolean toDownload)
-
filePriorityStateChanged
public void filePriorityStateChanged(TorrentOpenFileOptions torrentOpenFileOptions, int priority)
-
parentDirChanged
public void parentDirChanged()
-
initialTagsChanged
public void initialTagsChanged()
-
startOptionsChanged
public void startOptionsChanged()
-
setCompleteAction
public void setCompleteAction(int ca)
-
getCompleteAction
public int getCompleteAction()
-
setCancelDisabled
public void setCancelDisabled(boolean b)
-
cancel
public void cancel()
-
addModePreCreate
public static int addModePreCreate(int startMode)
-
addModeDuringCreate
public static void addModeDuringCreate(int startMode, DownloadManager dm)
-
addModePostCreate
public static void addModePostCreate(int startMode, DownloadManager dm)
-
addToDownloadManager
public boolean addToDownloadManager()
-
-