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
Fields Modifier and Type Field Description static int
READ
static int
ST_COMPACT
static int
ST_LINEAR
static int
ST_REORDER
static int
ST_REORDER_COMPACT
static int
WRITE
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
addListener(DiskManagerFileInfoListener listener)
void
close()
boolean
exists()
Checks that the linked file exists (always returns true for pad files)void
flushCache()
int
getAccessMode()
DiskManager
getDiskManager()
long
getDownloaded()
DownloadManager
getDownloadManager()
long
getETA()
java.lang.String
getExtension()
java.io.File
getFile(boolean follow_link)
int
getFirstPieceNumber()
int
getIndex()
java.lang.String
getLastError()
long
getLastModified()
int
getLastPieceNumber()
long
getLength()
java.io.File
getLink()
int
getNbPieces()
int
getPriority()
File Download Priorityint
getReadBytesPerSecond()
int
getStorageType()
Returns the storage type for this fileTOTorrentFile
getTorrentFile()
int
getWriteBytesPerSecond()
boolean
isSkipped()
Skipped files don't get downloaded.DirectByteBuffer
read(long offset, int length)
void
recheck()
void
removeListener(DiskManagerFileInfoListener listener)
boolean
setLink(java.io.File link_destination)
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(java.io.File link_destination)
boolean
setLinkAtomic(java.io.File link_destination, FileUtil.ProgressListener pl)
void
setPriority(int p)
void
setSkipped(boolean b)
default boolean
setStorageType(int type)
Download must be stopped before calling this!boolean
setStorageType(int type, boolean force)
-
-
-
Field Detail
-
READ
static final int READ
- See Also:
- Constant Field Values
-
WRITE
static final int WRITE
- See Also:
- Constant Field Values
-
ST_LINEAR
static final int ST_LINEAR
- See Also:
- Constant Field Values
-
ST_COMPACT
static final int ST_COMPACT
- See Also:
- Constant Field Values
-
ST_REORDER
static final int ST_REORDER
- See Also:
- Constant Field Values
-
ST_REORDER_COMPACT
static final int ST_REORDER_COMPACT
- See Also:
- Constant Field Values
-
-
Method Detail
-
setPriority
void setPriority(int p)
-
setSkipped
void setSkipped(boolean b)
-
setLink
boolean setLink(java.io.File link_destination)
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
boolean setLinkAtomic(java.io.File link_destination)
-
setLinkAtomic
boolean setLinkAtomic(java.io.File link_destination, FileUtil.ProgressListener pl)
-
getLink
java.io.File getLink()
-
setStorageType
default boolean setStorageType(int type)
Download must be stopped before calling this!- Parameters:
type
- one ofST_LINEAR
,ST_COMPACT
,ST_REORDER
,ST_REORDER_COMPACT
-
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
java.lang.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).
-
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
java.io.File getFile(boolean follow_link)
-
getTorrentFile
TOTorrentFile getTorrentFile()
-
read
DirectByteBuffer read(long offset, int length) throws java.io.IOException
- Throws:
java.io.IOException
-
flushCache
void flushCache() throws java.lang.Exception
- Throws:
java.lang.Exception
-
getReadBytesPerSecond
int getReadBytesPerSecond()
-
getWriteBytesPerSecond
int getWriteBytesPerSecond()
-
getETA
long getETA()
-
recheck
void recheck()
-
close
void close()
-
getLastError
java.lang.String getLastError()
-
addListener
void addListener(DiskManagerFileInfoListener listener)
-
removeListener
void removeListener(DiskManagerFileInfoListener listener)
-
-