Package com.biglybt.core.disk
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 int
static final int
static final int
static final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(DiskManagerFileInfoListener listener) void
close()
boolean
exists()
Checks that the linked file exists (always returns true for pad files)void
int
long
long
getETA()
getFile
(boolean follow_link) int
int
getIndex()
long
int
long
getLink()
int
int
File Download Priorityint
int
Returns the storage type for this fileint
default boolean
isLinked()
Download must be stopped before calling this!boolean
Skipped files don't get downloaded.read
(long offset, int length) void
recheck()
void
removeListener
(DiskManagerFileInfoListener listener) boolean
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).boolean
setLinkAtomic
(File link_destination, boolean no_delete) boolean
setLinkAtomic
(File link_destination, boolean no_delete, FileUtil.ProgressListener pl) void
setPriority
(int p) void
setSkipped
(boolean b) default boolean
setStorageType
(int type) boolean
setStorageType
(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:
<-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_COMPACT
andST_REORDER_COMPACT
will 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() -
getDiskManager
DiskManager getDiskManager() -
getFile
-
getTorrentFile
TOTorrentFile getTorrentFile() -
read
- Throws:
IOException
-
flushCache
- Throws:
Exception
-
getReadBytesPerSecond
int getReadBytesPerSecond() -
getWriteBytesPerSecond
int getWriteBytesPerSecond() -
getETA
long getETA() -
recheck
void recheck() -
close
void close() -
getLastError
String getLastError() -
addListener
-
removeListener
-