Java URL Build buildUrl(String host, String target)

Here you can find the source of buildUrl(String host, String target)

Description

Build the remote url:<br> http://host:8080/voxworx/target

License

Open Source License

Parameter

Parameter Description
host The spring host server
target The url suffix which defines the remoting service

Declaration

static String buildUrl(String host, String target) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    private static final int SERVICE_PORT = 8080;
    private static final String SERVLET_CONTEXT = "voxworx";

    /**/*from www .  j av a 2 s  .  c  o  m*/
     * Build the remote url:<br>
     * http://host:8080/voxworx/target
     * @param host The spring host server
     * @param target The url suffix which defines the remoting service
     * @return
     */
    static String buildUrl(String host, String target) {
        StringBuilder s = new StringBuilder();
        s.append("http://");
        s.append(host);
        s.append(":");
        s.append(SERVICE_PORT);
        s.append("/");
        s.append(SERVLET_CONTEXT);
        s.append("/");
        s.append(target);
        return s.toString();
    }
}

Related

  1. buildQueryString(Multimap params)
  2. buildURL(int imageId)
  3. buildUrl(String base, String local)
  4. buildUrl(String cid, String lid, String sid, String pid, String qid, String imageName)
  5. buildURL(String host, int port, String base, String ext)
  6. buildUrl(String protocol, String host, int port, String context)
  7. buildUrl(String scheme, String base, String path, String query)
  8. buildUrl(String scheme, String host, int port)
  9. buildUrl(String uri)