Java URL from makeURL(String id)

Here you can find the source of makeURL(String id)

Description

make URL

License

Open Source License

Declaration

private static URL makeURL(String id) 

Method Source Code

//package com.java2s;
/*/*from w  ww  .  j a v a2s .c om*/
 * Copyright 2011 StackFrame, LLC
 *
 * This is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 3
 * as published by the Free Software Foundation.
 *
 * You should have received a copy of the GNU General Public License
 * along with this file.  If not, see <http://www.gnu.org/licenses/>.
 */

import java.net.MalformedURLException;
import java.net.URL;

public class Main {
    private static URL makeURL(String id) {
        try {
            String base = "http://share.findmespot.com/messageService/guestlinkservlet";
            String full = String.format("%s?glId=%s&completeXml=true",
                    base, id);
            return new URL(full);
        } catch (MalformedURLException mue) {
            // This shouldn't happen as we are in control of what the URL looks like.
            throw new AssertionError(mue);
        }
    }
}

Related

  1. makeUrl(String base, String suffix)
  2. makeURL(String location)
  3. makeURL(String title, String urlString)
  4. makeUrl(String url)
  5. makeUrl(String url)