All Downloads are FREE. Search and download functionalities are using the official Maven repository.

bt.torrent.stub.StubTorrent Maven / Gradle / Ivy

There is a newer version: 1.10
Show newest version
package bt.torrent.stub;

import bt.metainfo.Torrent;
import bt.metainfo.TorrentFile;
import bt.metainfo.TorrentId;
import bt.metainfo.TorrentSource;
import bt.tracker.AnnounceKey;

import java.util.Collections;
import java.util.List;
import java.util.Optional;

public class StubTorrent implements Torrent {
    private static final StubTorrent instance = new StubTorrent();

    public static StubTorrent instance() {
        return instance;
    }

    @Override
    public TorrentSource getSource() {
        // TODO: return correct source, when torrent serialization is implemented
        // also in yourip.mock.MockTorrent
        return null;
    }

    @Override
    public Optional getAnnounceKey() {
        return Optional.empty();
    }

    @Override
    public TorrentId getTorrentId() {
        return TorrentId.fromBytes(new byte[20]);
    }

    @Override
    public String getName() {
        return "";
    }

    @Override
    public long getChunkSize() {
        return 0;
    }

    @Override
    public Iterable getChunkHashes() {
        return Collections.emptyList();
    }

    @Override
    public long getSize() {
        return 0;
    }

    @Override
    public List getFiles() {
        return Collections.emptyList();
    }

    @Override
    public boolean isPrivate() {
        return false;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy