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

bt.metainfo.DefaultTorrentFile Maven / Gradle / Ivy

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

import bt.BtException;

import java.util.List;

class DefaultTorrentFile implements TorrentFile {

    private long size;
    private List pathElements;

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

    @Override
    public List getPathElements() {
        return pathElements;
    }

    public void setSize(long size) {
        if (size < 0) {
            throw new BtException("Invalid torrent file size: " + size);
        }
        this.size = size;
    }

    public void setPathElements(List pathElements) {
        if (pathElements == null || pathElements.isEmpty()) {
            throw new BtException("Can't create torrent file without path");
        }
        this.pathElements = pathElements;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy