Class TorrentFileSet

    • Constructor Detail

      • TorrentFileSet

        public TorrentFileSet​(Metadata metadata,
                              File downloadFolder)
        Creates a TorrentFileSet instance based upon a .torrent file
        Parameters:
        metadata - The metadata containing the torrent information
        downloadFolder - The folder in which the downloads need to be stored.
        Throws:
        IllegalArgumentException - When the torrent file is missing or incomplete.
    • Method Detail

      • setHavingPiece

        public void setHavingPiece​(int pieceIndex)
        Description copied from class: AbstractFileSet
        Marks a piece as completed.
        Overrides:
        setHavingPiece in class AbstractFileSet
        Parameters:
        pieceIndex - the index of the piece
      • getPieceSize

        public long getPieceSize()
        Gets the default piece size
        Specified by:
        getPieceSize in class AbstractFileSet
        Returns:
        The default piece size
      • getBitfieldBytes

        public byte[] getBitfieldBytes()
        Description copied from class: AbstractFileSet
        Gets the have pieces in bitfield format as specified by BEP #3.
        Specified by:
        getBitfieldBytes in class AbstractFileSet
        Returns:
        The bitfield associated with this fileset.
      • getRequestFactory

        public org.johnnei.javatorrent.internal.torrent.TorrentFileSetRequestFactory getRequestFactory()
        Specified by:
        getRequestFactory in class AbstractFileSet
        Returns:
        The request factory which can create requests for this AbstractFileSet.
      • getDownloadFolder

        public File getDownloadFolder()