コード例 #1
0
 /**
  * Build the URL of the Vuze XML over HTTP plugin listener from the user settings.
  *
  * @return The URL of the RPC API
  */
 private String buildWebUIUrl() {
   return (settings.getSsl() ? "https://" : "http://")
       + settings.getAddress()
       + ":"
       + settings.getPort()
       + RPC_URL;
 }
コード例 #2
0
 /**
  * Build the URL of the Transmission web UI from the user settings.
  *
  * @return The URL of the RPC API
  */
 private String buildWebUIUrl() {
   String webuiroot = "";
   if (settings.getFolder() != null) {
     webuiroot = settings.getFolder();
   }
   return (settings.getSsl() ? "https://" : "http://")
       + settings.getAddress()
       + ":"
       + settings.getPort()
       + webuiroot
       + "/";
 }
コード例 #3
0
 /**
  * Creates a standard Apache HttpClient that is thread safe, supports different SSL auth methods
  * and basic authentication
  *
  * @param settings The server settings to adhere
  * @return An HttpClient that should be stored locally and reused for every new request
  * @throws DaemonException Thrown when information (such as username/password) is missing
  */
 public static DefaultHttpClient createStandardHttpClient(
     DaemonSettings settings, boolean userBasicAuth) throws DaemonException {
   return createStandardHttpClient(
       userBasicAuth && settings.shouldUseAuthentication(),
       settings.getUsername(),
       settings.getPassword(),
       settings.getSslTrustAll(),
       settings.getSslTrustKey(),
       settings.getTimeoutInMilliseconds(),
       settings.getAddress(),
       settings.getPort());
 }