Class RPTorrent

    • Field Detail

      • delegate

        protected transient Torrent delegate
      • name

        public java.lang.String name
      • size

        public long size
      • hash

        public byte[] hash
    • Constructor Detail

      • RPTorrent

        protected RPTorrent​(Torrent _delegate)
    • Method Detail

      • _setDelegate

        protected void _setDelegate​(java.lang.Object _delegate)
        Overrides:
        _setDelegate in class RPObject
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface Torrent
      • getAnnounceURL

        public java.net.URL getAnnounceURL()
        Specified by:
        getAnnounceURL in interface Torrent
      • setAnnounceURL

        public void setAnnounceURL​(java.net.URL url)
        Specified by:
        setAnnounceURL in interface Torrent
      • getAnnounceURLList

        public TorrentAnnounceURLList getAnnounceURLList()
        Description copied from interface: Torrent
        get the announce list for multi-tracker torrents. Will always be present but may contain 0 sets which means that this is not a multi-tracker torrent
        Specified by:
        getAnnounceURLList in interface Torrent
        Returns:
      • isDecentralised

        public boolean isDecentralised()
        Description copied from interface: Torrent
        A decentralised torrent uses the DHT only as a "tracker"
        Specified by:
        isDecentralised in interface Torrent
        Returns:
      • isDecentralisedBackupEnabled

        public boolean isDecentralisedBackupEnabled()
        Description copied from interface: Torrent
        Decentralised backup permits the DHT to be used as a tracker when the "real" tracker is unavailable
        Specified by:
        isDecentralisedBackupEnabled in interface Torrent
        Returns:
      • setDecentralisedBackupRequested

        public void setDecentralisedBackupRequested​(boolean requested)
        Description copied from interface: Torrent
        By default torrents with OK trackers are not tracked in the DHT. This allows a specific torrent to be marked so that it will be
        Specified by:
        setDecentralisedBackupRequested in interface Torrent
      • isPrivate

        public boolean isPrivate()
        Description copied from interface: Torrent
        A private torrent is either explicitly private via info/private or has decentralised backup disabled and peer exchange disabled
        Specified by:
        isPrivate in interface Torrent
        Returns:
      • wasCreatedByUs

        public boolean wasCreatedByUs()
        Specified by:
        wasCreatedByUs in interface Torrent
        Returns:
      • setPrivate

        public void setPrivate​(boolean priv)
        Specified by:
        setPrivate in interface Torrent
      • getHash

        public byte[] getHash()
        Description copied from interface: Torrent
        v1 torrent hash or truncated v2 hash if v2 only
        Specified by:
        getHash in interface Torrent
        Returns:
      • getSize

        public long getSize()
        Description copied from interface: Torrent
        If size is 0 then this is an "external" torrent and we only know its hash (and name constructed from hash). e.g. we don't know file details
        Specified by:
        getSize in interface Torrent
        Returns:
      • getComment

        public java.lang.String getComment()
        Specified by:
        getComment in interface Torrent
      • setComment

        public void setComment​(java.lang.String comment)
        Specified by:
        setComment in interface Torrent
      • getCreationDate

        public long getCreationDate()
        Description copied from interface: Torrent
        UNIX epoch format in seconds
        Specified by:
        getCreationDate in interface Torrent
      • getCreatedBy

        public java.lang.String getCreatedBy()
        Specified by:
        getCreatedBy in interface Torrent
      • getPieces

        public byte[][] getPieces()
        Specified by:
        getPieces in interface Torrent
      • getMagnetURI

        public java.net.URL getMagnetURI()
        Description copied from interface: Torrent
        Gets the magnet URI for the torrent - throws exception if not available
        Specified by:
        getMagnetURI in interface Torrent
        Returns:
      • getEncoding

        public java.lang.String getEncoding()
        Specified by:
        getEncoding in interface Torrent
      • setEncoding

        public void setEncoding​(java.lang.String encoding)
        Specified by:
        setEncoding in interface Torrent
      • getAdditionalProperty

        public java.lang.Object getAdditionalProperty​(java.lang.String name)
        Description copied from interface: Torrent
        Access to top-level properties in the torrent
        Specified by:
        getAdditionalProperty in interface Torrent
        Returns:
      • removeAdditionalProperties

        public Torrent removeAdditionalProperties()
        Description copied from interface: Torrent
        Removal all non-standard properties (excluding plugin-properties below)
        Specified by:
        removeAdditionalProperties in interface Torrent
        Returns:
      • setPluginStringProperty

        public void setPluginStringProperty​(java.lang.String name,
                                            java.lang.String value)
        Description copied from interface: Torrent
        Set a property specific to this plugin
        Specified by:
        setPluginStringProperty in interface Torrent
      • getPluginStringProperty

        public java.lang.String getPluginStringProperty​(java.lang.String name)
        Description copied from interface: Torrent
        Get a property specific to this plugin
        Specified by:
        getPluginStringProperty in interface Torrent
        Returns:
      • setMapProperty

        public void setMapProperty​(java.lang.String name,
                                   java.util.Map value)
        Description copied from interface: Torrent
        Sets a map property in the torrent, retrievable via getMapProperty
        Specified by:
        setMapProperty in interface Torrent
        Parameters:
        name - should be unique across plugins (i.e. prefix it with something unique)
        value - bencodable Map value
      • setComplete

        public void setComplete​(java.io.File data_dir)
                         throws TorrentException
        Description copied from interface: Torrent
        sets the torrent complete - i.e. ready for seeding. Doing this avoids a recheck on torrent addition
        Specified by:
        setComplete in interface Torrent
        Throws:
        TorrentException
      • isComplete

        public boolean isComplete()
        Specified by:
        isComplete in interface Torrent
      • isSimpleTorrent

        public boolean isSimpleTorrent()
        Description copied from interface: Torrent
        Returns true if the torrent is a single file torrent, false if it is a multi file torrent.
        Specified by:
        isSimpleTorrent in interface Torrent