bt.metainfo.DefaultTorrentFile Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bt-core Show documentation
Show all versions of bt-core Show documentation
BitTorrent Client Library (Core)
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;
}
}