com.groupdocs.metadata.core

Interfaces

Classes

Exceptions

com.groupdocs.metadata.core

Class TorrentRootPackage

  • All Implemented Interfaces:
    Iterable<MetadataProperty>


    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());
         }
         // ...
     }
     
    • Method Detail

      • getTorrentPackage

        public final TorrentPackage getTorrentPackage()

        Gets the TORRENT file metadata package.

        Returns:
        The TORRENT file metadata package.