@ -17,7 +17,61 @@
@@ -17,7 +17,61 @@
* /
package org.transdroid.daemon.Deluge ;
import android.support.annotation.NonNull ;
import org.base64.android.Base64 ;
import org.transdroid.core.gui.log.Log ;
import org.transdroid.daemon.Daemon ;
import org.transdroid.daemon.DaemonException ;
import org.transdroid.daemon.DaemonException.ExceptionType ;
import org.transdroid.daemon.DaemonSettings ;
import org.transdroid.daemon.IDaemonAdapter ;
import org.transdroid.daemon.Label ;
import org.transdroid.daemon.Priority ;
import org.transdroid.daemon.Torrent ;
import org.transdroid.daemon.TorrentDetails ;
import org.transdroid.daemon.TorrentFile ;
import org.transdroid.daemon.task.AddByFileTask ;
import org.transdroid.daemon.task.AddByMagnetUrlTask ;
import org.transdroid.daemon.task.AddByUrlTask ;
import org.transdroid.daemon.task.DaemonTask ;
import org.transdroid.daemon.task.DaemonTaskFailureResult ;
import org.transdroid.daemon.task.DaemonTaskResult ;
import org.transdroid.daemon.task.DaemonTaskSuccessResult ;
import org.transdroid.daemon.task.ForceRecheckTask ;
import org.transdroid.daemon.task.GetFileListTask ;
import org.transdroid.daemon.task.GetFileListTaskSuccessResult ;
import org.transdroid.daemon.task.GetTorrentDetailsTask ;
import org.transdroid.daemon.task.GetTorrentDetailsTaskSuccessResult ;
import org.transdroid.daemon.task.RemoveTask ;
import org.transdroid.daemon.task.RetrieveTask ;
import org.transdroid.daemon.task.RetrieveTaskSuccessResult ;
import org.transdroid.daemon.task.SetDownloadLocationTask ;
import org.transdroid.daemon.task.SetFilePriorityTask ;
import org.transdroid.daemon.task.SetLabelTask ;
import org.transdroid.daemon.task.SetTrackersTask ;
import org.transdroid.daemon.task.SetTransferRatesTask ;
import java.io.BufferedInputStream ;
import java.io.ByteArrayOutputStream ;
import java.io.File ;
import java.io.FileInputStream ;
import java.io.FileNotFoundException ;
import java.io.IOException ;
import java.net.URI ;
import java.util.ArrayList ;
import java.util.Collection ;
import java.util.Collections ;
import java.util.Date ;
import java.util.HashMap ;
import java.util.HashSet ;
import java.util.List ;
import java.util.Map ;
import java.util.Map.Entry ;
import java.util.Set ;
import static org.transdroid.daemon.Deluge.DelugeCommon.RPC_DETAILS ;
import static org.transdroid.daemon.Deluge.DelugeCommon.RPC_DETAILS_FIELDS_ARRAY ;
import static org.transdroid.daemon.Deluge.DelugeCommon.RPC_DOWNLOADEDEVER ;
import static org.transdroid.daemon.Deluge.DelugeCommon.RPC_ETA ;
import static org.transdroid.daemon.Deluge.DelugeCommon.RPC_FIELDS_ARRAY ;
@ -59,71 +113,18 @@ import static org.transdroid.daemon.Deluge.DelugeCommon.RPC_RATEUPLOAD;
@@ -59,71 +113,18 @@ import static org.transdroid.daemon.Deluge.DelugeCommon.RPC_RATEUPLOAD;
import static org.transdroid.daemon.Deluge.DelugeCommon.RPC_SAVEPATH ;
import static org.transdroid.daemon.Deluge.DelugeCommon.RPC_SIZE ;
import static org.transdroid.daemon.Deluge.DelugeCommon.RPC_STATUS ;
import static org.transdroid.daemon.Deluge.DelugeCommon.RPC_DE TAILS_F IELDS_A RRAY ;
import static org.transdroid.daemon.Deluge.DelugeCommon.RPC_TIER ;
import static org.transdroid.daemon.Deluge.DelugeCommon.RPC_TIMEADDED ;
import static org.transdroid.daemon.Deluge.DelugeCommon.RPC_TOTALPEERS ;
import static org.transdroid.daemon.Deluge.DelugeCommon.RPC_TOTALSEEDS ;
import static org.transdroid.daemon.Deluge.DelugeCommon.RPC_TOTALSIZE ;
import static org.transdroid.daemon.Deluge.DelugeCommon.RPC_TRACKERS ;
import static org.transdroid.daemon.Deluge.DelugeCommon.RPC_TRACKER_STATUS ;
import static org.transdroid.daemon.Deluge.DelugeCommon.RPC_TIER ;
import static org.transdroid.daemon.Deluge.DelugeCommon.RPC_URL ;
import static org.transdroid.daemon.Deluge.DelugeCommon.RPC_UPLOADEDEVER ;
import android.support.annotation.NonNull ;
import java.io.BufferedInputStream ;
import java.io.ByteArrayOutputStream ;
import java.io.File ;
import java.io.FileInputStream ;
import java.io.FileNotFoundException ;
import java.io.IOException ;
import java.net.URI ;
import java.util.ArrayList ;
import java.util.Collection ;
import java.util.Collections ;
import java.util.Date ;
import java.util.HashMap ;
import java.util.HashSet ;
import java.util.List ;
import java.util.Map ;
import java.util.Map.Entry ;
import java.util.Set ;
import org.base64.android.Base64 ;
import org.transdroid.core.gui.log.Log ;
import org.transdroid.daemon.Daemon ;
import org.transdroid.daemon.DaemonException ;
import org.transdroid.daemon.DaemonException.ExceptionType ;
import org.transdroid.daemon.DaemonSettings ;
import org.transdroid.daemon.IDaemonAdapter ;
import org.transdroid.daemon.Label ;
import org.transdroid.daemon.Priority ;
import org.transdroid.daemon.Torrent ;
import org.transdroid.daemon.TorrentDetails ;
import org.transdroid.daemon.TorrentFile ;
import org.transdroid.daemon.task.AddByFileTask ;
import org.transdroid.daemon.task.AddByMagnetUrlTask ;
import org.transdroid.daemon.task.AddByUrlTask ;
import org.transdroid.daemon.task.DaemonTask ;
import org.transdroid.daemon.task.DaemonTaskFailureResult ;
import org.transdroid.daemon.task.DaemonTaskResult ;
import org.transdroid.daemon.task.DaemonTaskSuccessResult ;
import org.transdroid.daemon.task.ForceRecheckTask ;
import org.transdroid.daemon.task.GetFileListTask ;
import org.transdroid.daemon.task.GetFileListTaskSuccessResult ;
import org.transdroid.daemon.task.GetTorrentDetailsTask ;
import org.transdroid.daemon.task.GetTorrentDetailsTaskSuccessResult ;
import org.transdroid.daemon.task.RemoveTask ;
import org.transdroid.daemon.task.RetrieveTask ;
import org.transdroid.daemon.task.RetrieveTaskSuccessResult ;
import org.transdroid.daemon.task.SetDownloadLocationTask ;
import org.transdroid.daemon.task.SetFilePriorityTask ;
import org.transdroid.daemon.task.SetLabelTask ;
import org.transdroid.daemon.task.SetTrackersTask ;
import org.transdroid.daemon.task.SetTransferRatesTask ;
import static org.transdroid.daemon.Deluge.DelugeCommon.RPC_URL ;
/ * *
* The daemon adapter from the Deluge torrent client using deluged API directly .
*
* @author alon . albert
* /
public class DelugeRpcAdapter implements IDaemonAdapter {
@ -142,7 +143,7 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -142,7 +143,7 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
public DaemonTaskResult executeTask ( Log log , DaemonTask task ) {
final DelugeRpcClient client = new DelugeRpcClient ( ) ;
try {
client . connect ( settings . getAddress ( ) , settings . getPort ( ) , settings . getUsername ( ) , settings . getPassword ( ) ) ;
client . connect ( settings ) ;
switch ( task . getMethod ( ) ) {
case Retrieve :
return doRetrieve ( client , ( RetrieveTask ) task ) ;
@ -179,9 +180,8 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -179,9 +180,8 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
case ForceRecheck :
return doForceRecheck ( client , ( ForceRecheckTask ) task ) ;
default :
return new DaemonTaskFailureResult ( task ,
new DaemonException ( ExceptionType . MethodUnsupported ,
task . getMethod ( ) + " is not supported by " + getType ( ) ) ) ;
return new DaemonTaskFailureResult ( task , new DaemonException ( ExceptionType . MethodUnsupported , task . getMethod ( ) + " is not " +
"supported by " + getType ( ) ) ) ;
}
} catch ( DaemonException e ) {
return new DaemonTaskFailureResult ( task , e ) ;
@ -204,8 +204,8 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -204,8 +204,8 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
private RetrieveTaskSuccessResult doRetrieve ( DelugeRpcClient client , RetrieveTask task ) throws DaemonException {
// Get torrents
//noinspection unchecked
final Map < String , Map < String , Object > > torrentsStatus = ( Map < String , Map < String , Object > > ) client
. sendRequest ( RPC_METHOD_GET_TORRENTS_STATUS , new HashMap < > ( ) , RPC_FIELDS_ARRAY ) ;
final Map < String , Map < String , Object > > torrentsStatus = ( Map < String , Map < String , Object > > ) client . sendRequest
( RPC_METHOD_GET_TORRENTS_STATUS , new HashMap < > ( ) , RPC_FIELDS_ARRAY ) ;
final List < Torrent > torrents = getTorrents ( torrentsStatus . values ( ) ) ;
// Check if Label plugin is enabled
@ -213,9 +213,7 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -213,9 +213,7 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
// Get label list from server
//noinspection unchecked
final List < String > labelNames = hasLabelPlugin
? ( List < String > ) client . sendRequest ( RPC_METHOD_GET_LABELS )
: new ArrayList < String > ( ) ;
final List < String > labelNames = hasLabelPlugin ? ( List < String > ) client . sendRequest ( RPC_METHOD_GET_LABELS ) : new ArrayList < String > ( ) ;
// Extract labels & counts from torrents.
final List < Label > labels = getLabels ( labelNames , torrents ) ;
@ -223,49 +221,39 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -223,49 +221,39 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
return new RetrieveTaskSuccessResult ( task , torrents , labels ) ;
}
private GetTorrentDetailsTaskSuccessResult doGetTorrentDetails ( DelugeRpcClient client ,
GetTorrentDetailsTask task )
throws DaemonException {
private GetTorrentDetailsTaskSuccessResult doGetTorrentDetails ( DelugeRpcClient client , GetTorrentDetailsTask task ) throws DaemonException {
//noinspection unchecked
final Map < String , Object > response = ( Map < String , Object > ) client . sendRequest (
RPC_METHOD_STATUS ,
task . getTargetTorrent ( ) . getUniqueID ( ) ,
final Map < String , Object > response = ( Map < String , Object > ) client . sendRequest ( RPC_METHOD_STATUS , task . getTargetTorrent ( ) . getUniqueID ( ) ,
RPC_DETAILS_FIELDS_ARRAY ) ;
//noinspection unchecked
final List < Map < String , Object > > trackerResponses = ( List < Map < String , Object > > ) response
. get ( RPC_TRACKERS ) ;
final List < Map < String , Object > > trackerResponses = ( List < Map < String , Object > > ) response . get ( RPC_TRACKERS ) ;
final List < String > trackers = new ArrayList < > ( ) ;
for ( Map < String , Object > trackerResponse : trackerResponses ) {
trackers . add ( ( String ) trackerResponse . get ( RPC_URL ) ) ;
}
return new GetTorrentDetailsTaskSuccessResult ( task , new TorrentDetails (
trackers ,
Collections . singletonList ( ( String ) response . get ( RPC_TRACKER_STATUS ) ) ) ) ;
return new GetTorrentDetailsTaskSuccessResult ( task , new TorrentDetails ( trackers , Collections . singletonList ( ( String ) response . get
( RPC_TRACKER_STATUS ) ) ) ) ;
}
private GetFileListTaskSuccessResult doGetFileList ( DelugeRpcClient client ,
GetFileListTask task ) throws DaemonException {
private GetFileListTaskSuccessResult doGetFileList ( DelugeRpcClient client , GetFileListTask task ) throws DaemonException {
final ArrayList < TorrentFile > files = getTorrentFiles ( client , task . getTargetTorrent ( ) ) ;
return new GetFileListTaskSuccessResult ( task , files ) ;
}
private DaemonTaskResult doControl ( DelugeRpcClient client , DaemonTask task ,
String method ) throws DaemonException {
private DaemonTaskResult doControl ( DelugeRpcClient client , DaemonTask task , String method ) throws DaemonException {
client . sendRequest ( method , ( Object ) getTorrentIdsArg ( task ) ) ;
return new DaemonTaskSuccessResult ( task ) ;
}
private DaemonTaskResult doRemove ( DelugeRpcClient client , RemoveTask task ) throws DaemonException {
client . sendRequest ( RPC_METHOD_REMOVE , task . getTargetTorrent ( ) . getUniqueID ( ) ,
task . includingData ( ) ) ;
client . sendRequest ( RPC_METHOD_REMOVE , task . getTargetTorrent ( ) . getUniqueID ( ) , task . includingData ( ) ) ;
return new DaemonTaskSuccessResult ( task ) ;
}
@NonNull
private DaemonTaskResult doControlAll ( DelugeRpcClient client , DaemonTask task ,
String method ) throws DaemonException {
private DaemonTaskResult doControlAll ( DelugeRpcClient client , DaemonTask task , String method ) throws DaemonException {
client . sendRequest ( method ) ;
return new DaemonTaskSuccessResult ( task ) ;
}
@ -285,8 +273,7 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -285,8 +273,7 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
}
@NonNull
private DaemonTaskResult doAddByMagnetUrl ( DelugeRpcClient client ,
AddByMagnetUrlTask task ) throws DaemonException {
private DaemonTaskResult doAddByMagnetUrl ( DelugeRpcClient client , AddByMagnetUrlTask task ) throws DaemonException {
client . sendRequest ( RPC_METHOD_ADD_MAGNET , task . getUrl ( ) , new HashMap < > ( ) ) ;
return new DaemonTaskSuccessResult ( task ) ;
}
@ -303,8 +290,7 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -303,8 +290,7 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
}
@NonNull
private DaemonTaskResult doSetFilePriorities ( DelugeRpcClient client ,
SetFilePriorityTask task ) throws DaemonException {
private DaemonTaskResult doSetFilePriorities ( DelugeRpcClient client , SetFilePriorityTask task ) throws DaemonException {
// We first need a listing of all the files (because we can only set the priorities all at once)
final ArrayList < TorrentFile > files = getTorrentFiles ( client , task . getTargetTorrent ( ) ) ;
@ -331,8 +317,7 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -331,8 +317,7 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
}
@NonNull
private DaemonTaskResult doSetTransferRates ( DelugeRpcClient client ,
SetTransferRatesTask task ) throws DaemonException {
private DaemonTaskResult doSetTransferRates ( DelugeRpcClient client , SetTransferRatesTask task ) throws DaemonException {
final Map < String , Object > config = new HashMap < > ( ) ;
config . put ( RPC_MAXDOWNLOAD , task . getDownloadRate ( ) = = null ? - 1 : task . getDownloadRate ( ) ) ;
config . put ( RPC_MAXUPLOAD , task . getUploadRate ( ) = = null ? - 1 : task . getUploadRate ( ) ) ;
@ -361,14 +346,13 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -361,14 +346,13 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
}
@NonNull
private DaemonTaskResult doSetDownloadLocation ( DelugeRpcClient client ,
SetDownloadLocationTask task ) throws DaemonException {
private DaemonTaskResult doSetDownloadLocation ( DelugeRpcClient client , SetDownloadLocationTask task ) throws DaemonException {
client . sendRequest ( RPC_METHOD_MOVESTORAGE , getTorrentIdsArg ( task ) , task . getNewLocation ( ) ) ;
return new DaemonTaskSuccessResult ( task ) ;
}
@NonNull
private List < Torrent > getTorrents ( Collection < Map < String , Object > > torrentMaps ) throws DaemonException {
private List < Torrent > getTorrents ( Collection < Map < String , Object > > torrentMaps ) {
final List < Torrent > torrents = new ArrayList < > ( ) ;
int id = 0 ;
for ( Map < String , Object > torrentMap : torrentMaps ) {
@ -390,35 +374,21 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -390,35 +374,21 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
error = message ;
}
torrents . add ( new Torrent (
id + + ,
( String ) torrentMap . get ( RPC_HASH ) ,
( String ) torrentMap . get ( RPC_NAME ) ,
DelugeCommon . convertDelugeState ( ( String ) torrentMap . get ( RPC_STATUS ) ) ,
torrentMap . get ( RPC_SAVEPATH ) + settings . getOS ( ) . getPathSeperator ( ) ,
( ( Number ) torrentMap . get ( RPC_RATEDOWNLOAD ) ) . intValue ( ) ,
( ( Number ) torrentMap . get ( RPC_RATEUPLOAD ) ) . intValue ( ) ,
( ( Number ) torrentMap . get ( RPC_NUMSEEDS ) ) . intValue ( ) ,
( ( Number ) torrentMap . get ( RPC_TOTALSEEDS ) ) . intValue ( ) ,
( ( Number ) torrentMap . get ( RPC_NUMPEERS ) ) . intValue ( ) ,
( ( Number ) torrentMap . get ( RPC_TOTALPEERS ) ) . intValue ( ) ,
( ( Number ) torrentMap . get ( RPC_ETA ) ) . intValue ( ) ,
( ( Number ) torrentMap . get ( RPC_DOWNLOADEDEVER ) ) . longValue ( ) ,
( ( Number ) torrentMap . get ( RPC_UPLOADEDEVER ) ) . longValue ( ) ,
( ( Number ) torrentMap . get ( RPC_TOTALSIZE ) ) . longValue ( ) ,
( ( Number ) torrentMap . get ( RPC_PARTDONE ) ) . floatValue ( ) / 100f ,
0f , // Not available
( String ) torrentMap . get ( RPC_LABEL ) ,
timeAddedDate ,
null , // Not available
error ,
getType ( ) ) ) ;
torrents . add ( new Torrent ( id + + , ( String ) torrentMap . get ( RPC_HASH ) , ( String ) torrentMap . get ( RPC_NAME ) , DelugeCommon . convertDelugeState (
( String ) torrentMap . get ( RPC_STATUS ) ) , torrentMap . get ( RPC_SAVEPATH ) + settings . getOS ( ) . getPathSeperator ( ) , ( ( Number ) torrentMap
. get ( RPC_RATEDOWNLOAD ) ) . intValue ( ) , ( ( Number ) torrentMap . get ( RPC_RATEUPLOAD ) ) . intValue ( ) , ( ( Number ) torrentMap . get
( RPC_NUMSEEDS ) ) . intValue ( ) , ( ( Number ) torrentMap . get ( RPC_TOTALSEEDS ) ) . intValue ( ) , ( ( Number ) torrentMap . get ( RPC_NUMPEERS ) )
. intValue ( ) , ( ( Number ) torrentMap . get ( RPC_TOTALPEERS ) ) . intValue ( ) , ( ( Number ) torrentMap . get ( RPC_ETA ) ) . intValue ( ) , ( ( Number )
torrentMap . get ( RPC_DOWNLOADEDEVER ) ) . longValue ( ) , ( ( Number ) torrentMap . get ( RPC_UPLOADEDEVER ) ) . longValue ( ) , ( ( Number ) torrentMap
. get ( RPC_TOTALSIZE ) ) . longValue ( ) , ( ( Number ) torrentMap . get ( RPC_PARTDONE ) ) . floatValue ( ) / 100f , 0f , // Not available
( String ) torrentMap . get ( RPC_LABEL ) , timeAddedDate , null , // Not available
error , getType ( ) ) ) ;
}
return torrents ;
}
@NonNull
private List < Label > getLabels ( List < String > labelsResponse , List < Torrent > torrents ) throws DaemonException {
private List < Label > getLabels ( List < String > labelsResponse , List < Torrent > torrents ) {
// First get all labels that torrents and count them
final Map < String , MutableInt > labelCounters = new HashMap < > ( ) ;
for ( Torrent torrent : torrents ) {
@ -450,14 +420,11 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -450,14 +420,11 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
private ArrayList < TorrentFile > getTorrentFiles ( DelugeRpcClient client , Torrent torrent ) throws DaemonException {
final ArrayList < TorrentFile > files = new ArrayList < > ( ) ;
//noinspection unchecked
final Map < String , Object > response = ( Map < String , Object > ) client . sendRequest (
RPC_METHOD_STATUS ,
torrent . getUniqueID ( ) ,
final Map < String , Object > response = ( Map < String , Object > ) client . sendRequest ( RPC_METHOD_STATUS , torrent . getUniqueID ( ) ,
RPC_FILE_FIELDS_ARRAY ) ;
//noinspection unchecked
final List < Map < String , Object > > fileMaps = ( List < Map < String , Object > > ) response
. get ( RPC_DETAILS ) ;
final List < Map < String , Object > > fileMaps = ( List < Map < String , Object > > ) response . get ( RPC_DETAILS ) ;
//noinspection unchecked
final List < Integer > priorities = ( List < Integer > ) response . get ( RPC_FILEPRIORITIES ) ;
//noinspection unchecked
@ -470,14 +437,8 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -470,14 +437,8 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
final String path = ( String ) fileMap . get ( RPC_PATH ) ;
final long size = ( ( Number ) fileMap . get ( RPC_SIZE ) ) . longValue ( ) ;
files . add ( new TorrentFile (
fileMap . get ( RPC_INDEX ) . toString ( ) ,
path ,
path ,
torrent . getLocationDir ( ) + path ,
size ,
( long ) ( size * progress ) ,
convertDelugePriority ( client , priority ) ) ) ;
files . add ( new TorrentFile ( fileMap . get ( RPC_INDEX ) . toString ( ) , path , path , torrent . getLocationDir ( ) + path , size , ( long ) ( size * progress )
, convertDelugePriority ( client , priority ) ) ) ;
}
return files ;
}
@ -489,8 +450,7 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -489,8 +450,7 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
try {
in = new BufferedInputStream ( new FileInputStream ( file ) ) ;
} catch ( FileNotFoundException e ) {
throw new DaemonException ( ExceptionType . FileAccessError ,
"File not found: " + file . getAbsolutePath ( ) ) ;
throw new DaemonException ( ExceptionType . FileAccessError , "File not found: " + file . getAbsolutePath ( ) ) ;
}
final ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ;
try {
@ -504,8 +464,7 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -504,8 +464,7 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
}
return out . toByteArray ( ) ;
} catch ( IOException e ) {
throw new DaemonException ( ExceptionType . FileAccessError ,
"Error reading file: " + file . getAbsolutePath ( ) ) ;
throw new DaemonException ( ExceptionType . FileAccessError , "Error reading file: " + file . getAbsolutePath ( ) ) ;
} finally {
try {
in . close ( ) ;
@ -516,8 +475,7 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
@@ -516,8 +475,7 @@ public class DelugeRpcAdapter implements IDaemonAdapter {
}
@NonNull
private Priority convertDelugePriority ( DelugeRpcClient client , int priority )
throws DaemonException {
private Priority convertDelugePriority ( DelugeRpcClient client , int priority ) throws DaemonException {
ensureVersion ( client ) ;
return DelugeCommon . convertDelugePriority ( priority , version ) ;
}