Search in sources :

Example 11 with RPException

use of com.biglybt.pifimpl.remote.RPException in project BiglyBT by BiglySoftware.

the class RPTracker method host.

// ************************************************************************
@Override
public TrackerTorrent host(Torrent torrent, boolean persistent) throws TrackerException {
    try {
        RPTrackerTorrent resp = (RPTrackerTorrent) _dispatcher.dispatch(new RPRequest(this, "host[Torrent,boolean]", new Object[] { torrent, Boolean.valueOf(persistent) })).getResponse();
        resp._setRemote(_dispatcher);
        return (resp);
    } catch (RPException e) {
        if (e.getCause() instanceof TrackerException) {
            throw ((TrackerException) e.getCause());
        }
        throw (e);
    }
}
Also used : RPRequest(com.biglybt.pifimpl.remote.RPRequest) TrackerException(com.biglybt.pif.tracker.TrackerException) RPException(com.biglybt.pifimpl.remote.RPException) RPObject(com.biglybt.pifimpl.remote.RPObject)

Example 12 with RPException

use of com.biglybt.pifimpl.remote.RPException in project BiglyBT by BiglySoftware.

the class RPDownloadManager method addDownload.

@Override
public Download addDownload(Torrent torrent, File torrent_location, File data_location) throws DownloadException {
    try {
        RPDownload res = (RPDownload) _dispatcher.dispatch(new RPRequest(this, "addDownload[Torrent,String,String]", new Object[] { torrent, torrent_location == null ? null : torrent_location.toString(), data_location == null ? null : data_location.toString() })).getResponse();
        res._setRemote(_dispatcher);
        return (res);
    } catch (RPException e) {
        if (e.getCause() instanceof DownloadException) {
            throw ((DownloadException) e.getCause());
        }
        throw (e);
    }
}
Also used : RPRequest(com.biglybt.pifimpl.remote.RPRequest) RPException(com.biglybt.pifimpl.remote.RPException) RPObject(com.biglybt.pifimpl.remote.RPObject)

Example 13 with RPException

use of com.biglybt.pifimpl.remote.RPException in project BiglyBT by BiglySoftware.

the class RPDownloadManager method addDownload.

@Override
public Download addDownload(Torrent torrent) throws DownloadException {
    try {
        RPDownload res = (RPDownload) _dispatcher.dispatch(new RPRequest(this, "addDownload[Torrent]", new Object[] { torrent })).getResponse();
        res._setRemote(_dispatcher);
        return (res);
    } catch (RPException e) {
        if (e.getCause() instanceof DownloadException) {
            throw ((DownloadException) e.getCause());
        }
        throw (e);
    }
}
Also used : RPRequest(com.biglybt.pifimpl.remote.RPRequest) RPException(com.biglybt.pifimpl.remote.RPException) RPObject(com.biglybt.pifimpl.remote.RPObject)

Aggregations

RPException (com.biglybt.pifimpl.remote.RPException)13 RPObject (com.biglybt.pifimpl.remote.RPObject)11 RPRequest (com.biglybt.pifimpl.remote.RPRequest)8 RPReply (com.biglybt.pifimpl.remote.RPReply)5 Torrent (com.biglybt.pif.torrent.Torrent)3 TorrentException (com.biglybt.pif.torrent.TorrentException)3 TrackerException (com.biglybt.pif.tracker.TrackerException)2 RPTorrent (com.biglybt.pifimpl.remote.torrent.RPTorrent)2 TrackerTorrent (com.biglybt.pif.tracker.TrackerTorrent)1 File (java.io.File)1 URL (java.net.URL)1