Example usage for java.net URL URL

List of usage examples for java.net URL URL

Introduction

In this page you can find the example usage for java.net URL URL.

Prototype

public URL(URL context, String spec) throws MalformedURLException 

Source Link

Document

Creates a URL by parsing the given spec within a specified context.

Usage

From source file:Main.java

public static URL getAttribURL(Element ele, String name, URL docRoot) {
    String sval = ele.getAttribute(name);

    try {/*  www  .j  a v  a 2 s.c om*/
        return new URL(docRoot, sval);
    } catch (Exception e) {
        return null;
    }
}