## Uses of Class
org.klomp.snark.Snark

- Packages that use Snark
  Package | Description
  --- | ---
  org.klomp.snark | I2P version of the snark bittorrent client, imported in 2005 and heavily enhanced to add a web UI, DHT support, and other features.
  org.klomp.snark.web | The I2PSnark web user interface package, providing a complete web-based torrent management system implemented as a webapp in i2psnark.war.

- - ### Uses of Snark in org.klomp.snark

    Methods in org.klomp.snark that return Snark
    Modifier and Type | Method and Description
    --- | ---
    `Snark` | SnarkManager.`addMagnet(String name, byte[] ih, String trackerURL, boolean updateStatus, boolean autoStart, File dataDir, CompleteListener listener)` Add a torrent with the info hash alone (magnet / maggot) External use is for UpdateRunner.
    `Snark` | SnarkManager.`getTorrent(String filename)` Grab the torrent given the (canonical) filename of the .torrent file
    `Snark` | SnarkManager.`getTorrentByBaseName(String filename)` Grab the torrent given the base name of the storage
    `Snark` | SnarkManager.`getTorrentByInfoHash(byte[] infohash)` Grab the torrent given the info hash
    `Snark` | SnarkManager.`stopTorrent(String filename, boolean shouldRemove)` Stop the torrent, leaving it on the list of torrents unless told to remove it.

    Methods in org.klomp.snark that return types with arguments of type Snark
    Modifier and Type | Method and Description
    --- | ---
    `Collection<Snark>` | SnarkManager.`getTorrents()` Unmodifiable

    Methods in org.klomp.snark with parameters of type Snark
    Modifier and Type | Method and Description
    --- | ---
    `void` | SnarkManager.`addDownloader(Snark torrent)` Add and start a FetchAndAdd task.
    `void` | CompleteListener.`addMessage(Snark snark, String message)`
    `void` | SnarkManager.`addMessage(Snark snark, String message)` A Snark.CompleteListener method.
    `void` | UpdateRunner.`addMessage(Snark snark, String message)`
    `void` | SnarkManager.`deleteMagnet(Snark snark)` Stop and delete a torrent running in magnet mode
    `void` | CompleteListener.`fatal(Snark snark, String error)`
    `void` | SnarkManager.`fatal(Snark snark, String error)` A Snark.CompleteListener method.
    `void` | UpdateRunner.`fatal(Snark snark, String error)`
    `long[]` | SnarkManager.`getSavedAddedAndCompleted(Snark snark)` Get setting for a torrent from the config file.
    `CommentSet` | CompleteListener.`getSavedComments(Snark snark)`
    `CommentSet` | SnarkManager.`getSavedComments(Snark snark)` The comments for a torrent
    `CommentSet` | UpdateRunner.`getSavedComments(Snark snark)`
    `boolean` | SnarkManager.`getSavedCommentsEnabled(Snark snark)` Get setting for comments enabled from the config file.
    `boolean` | CompleteListener.`getSavedPreserveNamesSetting(Snark snark)`
    `boolean` | SnarkManager.`getSavedPreserveNamesSetting(Snark snark)` Get setting for a torrent from the config file.
    `boolean` | UpdateRunner.`getSavedPreserveNamesSetting(Snark snark)`
    `BitField` | CompleteListener.`getSavedTorrentBitField(Snark snark)`
    `BitField` | SnarkManager.`getSavedTorrentBitField(Snark snark)` Get the saved bitfield for a torrent from the config file.
    `BitField` | UpdateRunner.`getSavedTorrentBitField(Snark snark)`
    `long` | CompleteListener.`getSavedTorrentTime(Snark snark)` not really listeners but the easiest way to get back to an optional SnarkManager
    `long` | SnarkManager.`getSavedTorrentTime(Snark snark)` Get the timestamp for a torrent from the config file.
    `long` | UpdateRunner.`getSavedTorrentTime(Snark snark)`
    `long` | CompleteListener.`getSavedUploaded(Snark snark)`
    `long` | SnarkManager.`getSavedUploaded(Snark snark)` Get setting for a torrent from the config file.
    `long` | UpdateRunner.`getSavedUploaded(Snark snark)`
    `String` | CompleteListener.`gotMetaInfo(Snark snark)` We transitioned from magnet mode, we have now initialized our metainfo and storage.
    `String` | SnarkManager.`gotMetaInfo(Snark snark)` We transitioned from magnet mode, we have now initialized our metainfo and storage.
    `String` | UpdateRunner.`gotMetaInfo(Snark snark)`
    `void` | CompleteListener.`gotPiece(Snark snark)`
    `void` | SnarkManager.`gotPiece(Snark snark)` A Snark.CompleteListener method.
    `void` | UpdateRunner.`gotPiece(Snark snark)`
    `void` | SnarkManager.`loadSavedFilePriorities(Snark snark)` Get the saved priorities for a torrent from the config file.
    `void` | CompleteListener.`locked_saveComments(Snark snark, CommentSet comments)`
    `void` | SnarkManager.`locked_saveComments(Snark snark, CommentSet comments)` Save the comments for a torrent Caller must synchronize on comments.
    `void` | UpdateRunner.`locked_saveComments(Snark snark, CommentSet comments)`
    `void` | SnarkManager.`recheckTorrent(Snark snark)` Threaded.
    `void` | SnarkManager.`saveTorrentStatus(Snark snark)` Save the completion status of a torrent and other data in the config file for that torrent.
    `void` | SnarkManager.`setSavedCommentsEnabled(Snark snark, boolean yes)` Set setting for comments enabled in the config file.
    `void` | SnarkManager.`startTorrent(Snark snark)` If not connected, thread it, otherwise inline
    `void` | SnarkManager.`stopTorrent(Snark torrent)` Stop the torrent only, leaving it on the list of torrents.
    `void` | SnarkManager.`stopTorrent(Snark torrent, boolean shouldRemove)` Stop the torrent, leaving it on the list of torrents unless told to remove it.
    `void` | CompleteListener.`torrentComplete(Snark snark)`
    `void` | SnarkManager.`torrentComplete(Snark snark)` A Snark.CompleteListener method.
    `void` | UpdateRunner.`torrentComplete(Snark snark)`
    `void` | CompleteListener.`updateStatus(Snark snark)`
    `void` | SnarkManager.`updateStatus(Snark snark)` A Snark.CompleteListener method.
    `void` | UpdateRunner.`updateStatus(Snark snark)` This is called by stopTorrent() among others

    Constructors in org.klomp.snark with parameters of type Snark
    Constructor and Description
    `PeerCoordinator(I2PSnarkUtil util, byte[] id, byte[] infohash, MetaInfo metainfo, Storage storage, CoordinatorListener listener, Snark torrent, BandwidthListener bwl)`
    `TrackerClient(I2PSnarkUtil util, MetaInfo meta, String additionalTrackerURL, PeerCoordinator coordinator, Snark snark)` Call start() to start it.

  - ### Uses of Snark in org.klomp.snark.web

    Subclasses of Snark in org.klomp.snark.web
    Modifier and Type | Class and Description
    --- | ---
    `class` | `FetchAndAdd` A cancellable torrent file downloader.

    Methods in org.klomp.snark.web that return types with arguments of type Snark
    Modifier and Type | Method and Description
    --- | ---
    `static Comparator<Snark>` | Sorters.`getComparator(int type, String lang, I2PSnarkServlet servlet)` Negative is reverse 0, 1: Name 2: Status 3: Peers 4: ETA 5: Size 6: Downloaded 7: Uploaded 8: Down rate 9: Up rate 10: Remaining (needed) 11: Upload ratio 12: File type