TorrentRootPackage

Inheritance: java.lang.Object, com.groupdocs.metadata.core.MetadataPackage, com.groupdocs.metadata.core.RootMetadataPackage

public class TorrentRootPackage extends RootMetadataPackage

Represents the root package intended to work with metadata of a TORRENT file.

Learn more

This code sample shows how to read metadata of a TORRENT file.

try (Metadata metadata = new Metadata(Constants.InputTorrent)) { TorrentRootPackage root = metadata.getRootPackageGeneric(); System.out.println(root.getTorrentPackage().getAnnounce()); System.out.println(root.getTorrentPackage().getComment()); System.out.println(root.getTorrentPackage().getCreatedBy()); System.out.println(root.getTorrentPackage().getCreationDate()); for (TorrentSharedFilePackage file : root.getTorrentPackage().getSharedFiles()) { System.out.println(file.getName()); System.out.println(file.getLength()); } // … }

Methods

Method Description
getTorrentPackage() Gets the TORRENT file metadata package.

getTorrentPackage()

public final TorrentPackage getTorrentPackage()

Gets the TORRENT file metadata package.

Returns: TorrentPackage - The TORRENT file metadata package.