Package com.biglybt.ui.swt.views
Class FilesView.FilesViewNodeInner
java.lang.Object
com.biglybt.ui.swt.views.FilesView.FilesViewNodeInner
- All Implemented Interfaces:
DiskManagerFileInfo
,FilesView.FilesViewTreeNode
,TableRowSWTChildController
- Enclosing class:
FilesView
private static class FilesView.FilesViewNodeInner
extends Object
implements DiskManagerFileInfo, FilesView.FilesViewTreeNode, TableRowSWTChildController
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DownloadManager
private boolean
private final Map
<String, FilesView.FilesViewTreeNode> private final String
private final StringInterner.FileKey
private final FilesView.FilesViewNodeInner
private int[]
private long
private final int
Fields inherited from interface com.biglybt.core.disk.DiskManagerFileInfo
READ, ST_COMPACT, ST_LINEAR, ST_REORDER, ST_REORDER_COMPACT, WRITE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
FilesViewNodeInner
(DownloadManager _dm, int _uid, String _node_name, StringInterner.FileKey _node_path, FilesView.FilesViewNodeInner _parent) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
private void
void
addListener
(DiskManagerFileInfoListener listener) void
close()
boolean
exists()
Checks that the linked file exists (always returns true for pad files)void
int
private FilesView.FilesViewTreeNode
Object[]
int
getDepth()
long
long
getETA()
getFile
(boolean follow_link) protected List
<DiskManagerFileInfo> getFiles
(boolean recursive) private void
getFiles
(List<DiskManagerFileInfo> files, boolean recursive) int
int
getIndex()
getKids()
long
int
void
getLeaves
(List<FilesView.FilesViewNodeLeaf> result) long
getLink()
getName()
int
protected String
private void
void
getPieceInfo
(int[] data) int
File Download Priorityint
int
int
Returns the storage type for this fileprotected int
getUID()
int
boolean
boolean
isLeaf()
boolean
Skipped files don't get downloaded.read
(long offset, int length) void
recheck()
void
removeListener
(DiskManagerFileInfoListener listener) void
setExpanded
(boolean e) 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) boolean
setStorageType
(int type, boolean force) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.biglybt.core.disk.DiskManagerFileInfo
isLinked, setStorageType
-
Field Details
-
dm
-
uid
private final int uid -
node_name
-
node_path
-
parent
-
kids
-
expanded
private boolean expanded -
size
private long size -
pieceInfo
private int[] pieceInfo
-
-
Constructor Details
-
FilesViewNodeInner
private FilesViewNodeInner(DownloadManager _dm, int _uid, String _node_name, StringInterner.FileKey _node_path, FilesView.FilesViewNodeInner _parent)
-
-
Method Details
-
getUID
protected int getUID() -
getParent
- Specified by:
getParent
in interfaceFilesView.FilesViewTreeNode
-
getKids
- Specified by:
getKids
in interfaceFilesView.FilesViewTreeNode
-
isLeaf
public boolean isLeaf()- Specified by:
isLeaf
in interfaceFilesView.FilesViewTreeNode
-
getChild
-
addChild
-
getFiles
-
getFiles
-
getName
- Specified by:
getName
in interfaceFilesView.FilesViewTreeNode
-
getNodePath
-
isExpanded
public boolean isExpanded()- Specified by:
isExpanded
in interfaceTableRowSWTChildController
-
setExpanded
public void setExpanded(boolean e) - Specified by:
setExpanded
in interfaceTableRowSWTChildController
-
getDepth
public int getDepth()- Specified by:
getDepth
in interfaceFilesView.FilesViewTreeNode
-
addFile
-
getChildDataSources
- Specified by:
getChildDataSources
in interfaceTableRowSWTChildController
-
setPriority
public void setPriority(int p) - Specified by:
setPriority
in interfaceDiskManagerFileInfo
-
setSkipped
public void setSkipped(boolean b) - Specified by:
setSkipped
in interfaceDiskManagerFileInfo
- Specified by:
setSkipped
in interfaceFilesView.FilesViewTreeNode
-
getLeaves
- Specified by:
getLeaves
in interfaceFilesView.FilesViewTreeNode
-
isSkipping
- Specified by:
isSkipping
in interfaceDiskManagerFileInfo
- Specified by:
isSkipping
in interfaceFilesView.FilesViewTreeNode
-
setLink
Description copied from interface:DiskManagerFileInfo
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.- Specified by:
setLink
in interfaceDiskManagerFileInfo
- Parameters:
link_destination
-- Returns:
- true - worked, false - failed, use getLastError to possibly get some extra info
-
exists
public boolean exists()Description copied from interface:DiskManagerFileInfo
Checks that the linked file exists (always returns true for pad files)- Specified by:
exists
in interfaceDiskManagerFileInfo
- Returns:
-
getLastError
- Specified by:
getLastError
in interfaceDiskManagerFileInfo
-
setLinkAtomic
- Specified by:
setLinkAtomic
in interfaceDiskManagerFileInfo
-
setLinkAtomic
public boolean setLinkAtomic(File link_destination, boolean no_delete, FileUtil.ProgressListener pl) - Specified by:
setLinkAtomic
in interfaceDiskManagerFileInfo
-
getLink
- Specified by:
getLink
in interfaceDiskManagerFileInfo
-
setStorageType
public boolean setStorageType(int type, boolean force) - Specified by:
setStorageType
in interfaceDiskManagerFileInfo
- Parameters:
type
-force
- discards any existing file content if it exists - use with care...- Returns:
-
getStorageType
public int getStorageType()Description copied from interface:DiskManagerFileInfo
Returns the storage type for this file- Specified by:
getStorageType
in interfaceDiskManagerFileInfo
- Returns:
DiskManagerFileInfo.ST_LINEAR
,DiskManagerFileInfo.ST_COMPACT
,DiskManagerFileInfo.ST_REORDER
,DiskManagerFileInfo.ST_REORDER_COMPACT
-
getAccessMode
public int getAccessMode()- Specified by:
getAccessMode
in interfaceDiskManagerFileInfo
-
getDownloaded
public long getDownloaded()- Specified by:
getDownloaded
in interfaceDiskManagerFileInfo
- Specified by:
getDownloaded
in interfaceFilesView.FilesViewTreeNode
-
getLastModified
public long getLastModified()- Specified by:
getLastModified
in interfaceDiskManagerFileInfo
-
getExtension
- Specified by:
getExtension
in interfaceDiskManagerFileInfo
-
getFirstPieceNumber
public int getFirstPieceNumber()- Specified by:
getFirstPieceNumber
in interfaceDiskManagerFileInfo
-
getLastPieceNumber
public int getLastPieceNumber()- Specified by:
getLastPieceNumber
in interfaceDiskManagerFileInfo
-
getPieceInfo
private void getPieceInfo() -
getPieceInfo
public void getPieceInfo(int[] data) - Specified by:
getPieceInfo
in interfaceFilesView.FilesViewTreeNode
-
getNbPieces
public int getNbPieces()- Specified by:
getNbPieces
in interfaceDiskManagerFileInfo
-
getLength
public long getLength()- Specified by:
getLength
in interfaceDiskManagerFileInfo
- Specified by:
getLength
in interfaceFilesView.FilesViewTreeNode
-
getPriority
public int getPriority()Description copied from interface:DiskManagerFileInfo
File Download Priority- Specified by:
getPriority
in interfaceDiskManagerFileInfo
- Returns:
- Common:
-1
: Low
0
: Normal
1
: High
Not Common:
invalid input: '<'-1
: Lower and Lower
>0
: Higher and Higher
-
isSkipped
public boolean isSkipped()Description copied from interface:DiskManagerFileInfo
Skipped files don't get downloaded. The state of the existing data is dependent uponDiskManagerFileInfo.getStorageType()
. StatesDiskManagerFileInfo.ST_COMPACT
andDiskManagerFileInfo.ST_REORDER_COMPACT
will delete (or trim) the file. Other states will retain existing data (ie. Do Not Download).- Specified by:
isSkipped
in interfaceDiskManagerFileInfo
-
getSkippedState
public int getSkippedState()- Specified by:
getSkippedState
in interfaceFilesView.FilesViewTreeNode
-
getIndex
public int getIndex()- Specified by:
getIndex
in interfaceDiskManagerFileInfo
-
getDownloadManager
- Specified by:
getDownloadManager
in interfaceDiskManagerFileInfo
-
getDiskManager
- Specified by:
getDiskManager
in interfaceDiskManagerFileInfo
-
getFile
- Specified by:
getFile
in interfaceDiskManagerFileInfo
-
getTorrentFile
- Specified by:
getTorrentFile
in interfaceDiskManagerFileInfo
-
read
- Specified by:
read
in interfaceDiskManagerFileInfo
- Throws:
IOException
-
flushCache
- Specified by:
flushCache
in interfaceDiskManagerFileInfo
- Throws:
Exception
-
getReadBytesPerSecond
public int getReadBytesPerSecond()- Specified by:
getReadBytesPerSecond
in interfaceDiskManagerFileInfo
-
getWriteBytesPerSecond
public int getWriteBytesPerSecond()- Specified by:
getWriteBytesPerSecond
in interfaceDiskManagerFileInfo
-
getETA
public long getETA()- Specified by:
getETA
in interfaceDiskManagerFileInfo
-
recheck
public void recheck()- Specified by:
recheck
in interfaceDiskManagerFileInfo
- Specified by:
recheck
in interfaceFilesView.FilesViewTreeNode
-
close
public void close()- Specified by:
close
in interfaceDiskManagerFileInfo
-
addListener
- Specified by:
addListener
in interfaceDiskManagerFileInfo
-
removeListener
- Specified by:
removeListener
in interfaceDiskManagerFileInfo
-