Packages that use MetaInfo
Package
Description
I2P version of the Snark BitTorrent client, enhanced for I2P: peers are I2P destinations, torrents can be served anonymously as hidden services, and metadata carries I2P-specific comment fields.
The I2PSnark web interface (i2psnark.war): servlets and helpers for torrent management, file browsing and configuration.
Uses of MetaInfo in org.klomp.snark
Fields in org.klomp.snark declared as MetaInfoModifier and TypeFieldDescriptionprivate final MetaInfoPartialPiece._metaBEP 47: to recognize padding-only chunks and skip requesting them; may be null.private MetaInfoSnark.metaMetadata of the torrent being downloaded.private MetaInfoTrackerClient.metaThe torrent's metadata, reassigned by reinitialize.private MetaInfoMagnetState.metainfoOnly valid when finished.protected MetaInfoPeer.metainfoWill start out null in magnet mode.(package private) MetaInfoPeerCoordinator.metainfoWill be null when in magnet mode.private MetaInfoPeerState.metainfoNull before we have it.private final MetaInfoStorage.metainfoThe torrent's metadata.Methods in org.klomp.snark that return MetaInfoModifier and TypeMethodDescriptionprivate MetaInfoMagnetState.buildMetaInfo()Builds a MetaInfo from the collected metadata bytes.MagnetState.getMetaInfo()Returns the MetaInfo for this magnet state.PeerCoordinator.getMetaInfo()Returns the metainfo for this torrent.Snark.getMetaInfo()The metainfo.Storage.getMetaInfo()Returns the MetaInfo associated with this Storage.MetaInfo.reannounce(String announce) Creates a copy of this MetaInfo that shares everything except the announce URL.Methods in org.klomp.snark with parameters of type MetaInfoModifier and TypeMethodDescriptionbooleanSnarkManager.addTorrent(MetaInfo metainfo, BitField bitfield, String filename, File baseFile, boolean dontAutoStart) Add a torrent from a MetaInfo.TrackerInfo.getPeers(byte[] l, byte[] my_id, byte[] infohash, MetaInfo metainfo, I2PSnarkUtil util) One big string of concatenated 32-byte hashes.TrackerInfo.getPeers(List<BEValue> l, byte[] my_id, byte[] infohash, MetaInfo metainfo, I2PSnarkUtil util) List of Dictionaries or List of Strings.TrackerInfo.getPeers(Set<Hash> hashes, byte[] my_id, byte[] infohash, MetaInfo metainfo, I2PSnarkUtil util) From Hash to Peer.(package private) static FileStorage.getStagingBase(String tempDir, String baseName, MetaInfo metainfo) The staging directory for a torrent: the configured temp dir plus a subdirectory unique to the torrent.voidCoordinatorListener.gotMetaInfo(PeerCoordinator coordinator, MetaInfo metainfo) Called when the PeerCoordinator got the MetaInfo via magnet.voidSnark.gotMetaInfo(PeerCoordinator coordinator, MetaInfo metainfo) Called when the PeerCoordinator got the MetaInfo via magnet.private voidSnarkManager.locked_saveTorrentStatus(MetaInfo metainfo, BitField bitfield, int[] priorities, File base, long uploaded, long activity, boolean stopped, Boolean comments) Writes one torrent's progress into its config.private static voidSnarkManager.locked_writeMetaInfo(MetaInfo metainfo, String filename, boolean areFilesPublic) Write the metainfo to the file, caller must hold the snarks lock to prevent interference from the DirMonitor.voidSnark.replaceMetaInfo(MetaInfo metainfo) Call after editing torrent.private voidSnarkManager.saveTorrentStatus(MetaInfo metainfo, BitField bitfield, int[] priorities, File base, long uploaded, long activity, boolean stopped, Boolean comments) Save the completion status of a torrent and the current time in the metadata file.voidMagnetState.setMetaInfo(MetaInfo meta) Store the MetaInfo for a completed magnet download.voidPeer.setMetaInfo(MetaInfo meta) Switches from magnet mode to normal mode with metainfo.voidPeerState.setMetaInfo(MetaInfo meta) Switch from magnet mode to normal mode.private StringSnarkManager.validateTorrent(MetaInfo info) Does not really delete on failure, that's the caller's responsibility.Constructors in org.klomp.snark with parameters of type MetaInfoModifierConstructorDescriptionMagnetState(byte[] iHash, MetaInfo meta) Creates a new MagnetState for the given info hash.MetaInfo(MetaInfo old, String newAnnounce, List<List<String>> newAnnounceList, String newComment, String newCreatedBy, List<String> newUrlList) Will not change infohash.PartialPiece(Piece piece, int len, File tempDir, MetaInfo meta) A PartialPiece for the given piece with the specified length.Peer(I2PSocket sock, InputStream in, OutputStream out, byte[] myId, byte[] infohash, MetaInfo metainfo) Incoming connection.Outgoing connection.PeerCoordinator(I2PSnarkUtil util, byte[] id, byte[] infohash, MetaInfo metainfo, Storage storage, CoordinatorListener listener, Snark torrent, BandwidthListener bwl) Create a peer coordinator for the torrent.(package private)PeerState(Peer peer, PeerListener listener, BandwidthListener bwl, MetaInfo metainfo, PeerConnectionIn in, PeerConnectionOut out) Create the peer state for the torrent.Storage(I2PSnarkUtil util, File baseFile, MetaInfo metainfo, StorageListener listener, boolean preserveFileNames) Creates a new storage based on the supplied MetaInfo.TrackerClient(I2PSnarkUtil util, MetaInfo meta, String additionalTrackerURL, PeerCoordinator coordinator, Snark snark) Call start() to start it.TrackerInfo(InputStream in, byte[] my_id, byte[] infohash, MetaInfo metainfo, I2PSnarkUtil util) Reads a tracker response from a stream and parses it.privateTrackerInfo(Map<String, BEValue> m, byte[] my_id, byte[] infohash, MetaInfo metainfo, I2PSnarkUtil util) Reads a tracker response into a record.TrackerInfo(Set<Hash> hashes, int interval, int complete, int incomplete, int downloaders, String error, byte[] my_id, byte[] infohash, MetaInfo metainfo, I2PSnarkUtil util) To convert returned UDPTracker data to the standard structure.privateTrackerInfo(BDecoder be, byte[] my_id, byte[] infohash, MetaInfo metainfo, I2PSnarkUtil util) Parses a tracker response from a decoder.WebPeer(PeerCoordinator coord, URI uri, PeerID peerID, MetaInfo metainfo) Outgoing connection.Uses of MetaInfo in org.klomp.snark.web
Fields in org.klomp.snark.web declared as MetaInfoModifier and TypeFieldDescription(package private) final MetaInfoI2PSnarkServlet.PeerRowContext.metaThe torrent metadata, null for magnet links.Methods in org.klomp.snark.web with parameters of type MetaInfoModifier and TypeMethodDescriptionprivate voidI2PSnarkServlet.appendPeerRow(StringBuilder buf, Peer peer, Snark snark, MetaInfo meta, boolean noThinsp) Appends HTML for a single peer row to the given StringBuilder.(package private) static I2PSnarkServlet.AnnounceListResultI2PSnarkServlet.buildAnnounceList(MetaInfo meta, I2PSnarkServlet.EditParams ep, List<Tracker> trackers, boolean udpEnabled) Builds the new announce list and primary tracker from the current MetaInfo and edit parameters.(package private) static booleanI2PSnarkServlet.hasChanges(MetaInfo meta, I2PSnarkServlet.EditParams ep) Determines whether the edit parameters represent any actual change to the torrent's metadata.Constructors in org.klomp.snark.web with parameters of type MetaInfoModifierConstructorDescription(package private)PeerRowContext(Snark snark, MetaInfo meta, boolean noThinsp) Captures the torrent and metadata needed to render one peer row.