Interface DiskManagerFileInfo
- All Known Subinterfaces:
DiskManagerFileInfoHelper
- All Known Implementing Classes:
DiskManagerFileInfoImpl, DiskManagerUtil.FileSkeleton, DownloadManagerController.fileInfoFacade, FilesView.FilesViewNodeInner, FilesView.FilesViewNodeLeaf
public interface DiskManagerFileInfo
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(DiskManagerFileInfoListener listener) voidclose()booleanexists()Checks that the linked file exists (always returns true for pad files)voidintlonglonggetETA()getFile(boolean follow_link) intintgetIndex()longintlonggetLink()intintFile Download PriorityintintReturns the storage type for this fileintdefault booleanisLinked()Download must be stopped before calling this!default booleanbooleanSkipped files don't get downloaded.read(long offset, int length) voidrecheck()voidremoveListener(DiskManagerFileInfoListener listener) booleanRelink the file to the destination given - this method deals with if the file is part of a simple torrent or not (so it may set the download name to keep it in sync).booleansetLinkAtomic(File link_destination, boolean no_delete) booleansetLinkAtomic(File link_destination, boolean no_delete, FileUtil.ProgressListener pl) voidsetPriority(int p) voidsetSkipped(boolean b) default booleansetStorageType(int type) booleansetStorageType(int type, boolean force)
-
Field Details
-
READ
static final int READ- See Also:
-
WRITE
static final int WRITE- See Also:
-
ST_LINEAR
static final int ST_LINEAR- See Also:
-
ST_COMPACT
static final int ST_COMPACT- See Also:
-
ST_REORDER
static final int ST_REORDER- See Also:
-
ST_REORDER_COMPACT
static final int ST_REORDER_COMPACT- See Also:
-
-
Method Details
-
setPriority
void setPriority(int p) -
setSkipped
void setSkipped(boolean b) -
setLink
Relink the file to the destination given - this method deals with if the file is part of a simple torrent or not (so it may set the download name to keep it in sync). If you just want a simple relink, use setLinkAtomic.- Parameters:
link_destination-- Returns:
- true - worked, false - failed, use getLastError to possibly get some extra info
-
setLinkAtomic
-
setLinkAtomic
-
getLink
File getLink() -
isLinked
default boolean isLinked()Download must be stopped before calling this!- Parameters:
type- one ofST_LINEAR,ST_COMPACT,ST_REORDER,ST_REORDER_COMPACT
-
setStorageType
default boolean setStorageType(int type) -
setStorageType
boolean setStorageType(int type, boolean force) - Parameters:
type-force- discards any existing file content if it exists - use with care...- Returns:
-
getStorageType
int getStorageType()Returns the storage type for this file- Returns:
ST_LINEAR,ST_COMPACT,ST_REORDER,ST_REORDER_COMPACT
-
getAccessMode
int getAccessMode() -
getDownloaded
long getDownloaded() -
getLastModified
long getLastModified() -
getExtension
String getExtension() -
getFirstPieceNumber
int getFirstPieceNumber() -
getLastPieceNumber
int getLastPieceNumber() -
getLength
long getLength() -
getNbPieces
int getNbPieces() -
getPriority
int getPriority()File Download Priority- Returns:
- Common:
-1: Low
0: Normal
1: High
Not Common:
invalid input: '<'-1: Lower and Lower
>0: Higher and Higher
-
isSkipped
boolean isSkipped()Skipped files don't get downloaded. The state of the existing data is dependent upongetStorageType(). StatesST_COMPACTandST_REORDER_COMPACTwill delete (or trim) the file. Other states will retain existing data (ie. Do Not Download). -
isSkipping
Boolean isSkipping() -
exists
boolean exists()Checks that the linked file exists (always returns true for pad files)- Returns:
-
getIndex
int getIndex() -
getDownloadManager
DownloadManager getDownloadManager() -
isMetadataDownload
default boolean isMetadataDownload() -
getDiskManager
DiskManager getDiskManager() -
getFile
-
getTorrentFile
TOTorrentFile getTorrentFile() -
read
- Throws:
IOException
-
flushCache
-
getReadBytesPerSecond
int getReadBytesPerSecond() -
getWriteBytesPerSecond
int getWriteBytesPerSecond() -
getETA
long getETA() -
recheck
void recheck() -
close
void close() -
getLastError
String getLastError() -
addListener
-
removeListener
-