Interface DiskManagerFileInfo

All Known Subinterfaces:
DiskManagerFileInfoHelper
All Known Implementing Classes:
DiskManagerFileInfoImpl, DiskManagerUtil.FileSkeleton, DownloadManagerController.fileInfoFacade, FilesView.FilesViewNodeInner, FilesView.FilesViewNodeLeaf

public interface DiskManagerFileInfo
  • Field Details

  • Method Details

    • setPriority

      void setPriority(int p)
    • setSkipped

      void setSkipped(boolean b)
    • setLink

      boolean setLink(File link_destination, boolean no_delete)
      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(File link_destination, boolean no_delete)
    • setLinkAtomic

      boolean setLinkAtomic(File link_destination, boolean no_delete, FileUtil.ProgressListener pl)
    • getLink

      File getLink()
    • isLinked

      default boolean isLinked()
      Download must be stopped before calling this!
      Parameters:
      type - one of ST_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 upon getStorageType(). States ST_COMPACT and ST_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

      File getFile(boolean follow_link)
    • getTorrentFile

      TOTorrentFile getTorrentFile()
    • read

      DirectByteBuffer read(long offset, int length) throws IOException
      Throws:
      IOException
    • flushCache

      void flushCache() throws Exception
      Throws:
      Exception
    • getReadBytesPerSecond

      int getReadBytesPerSecond()
    • getWriteBytesPerSecond

      int getWriteBytesPerSecond()
    • getETA

      long getETA()
    • recheck

      void recheck()
    • close

      void close()
    • getLastError

      String getLastError()
    • addListener

      void addListener(DiskManagerFileInfoListener listener)
    • removeListener

      void removeListener(DiskManagerFileInfoListener listener)