Code example for URI

Methods: toURL

    private final URI uri;
    public UriBinary(final String id, final String fileName, final String mimeType, final long size, final URI uri) {
        super(id, fileName, mimeType, size);
        Validate.notNull(uri, "URI may not be null");
        try { 
        } catch (MalformedURLException e) {
            throw new IllegalArgumentException("Invalid URI: " + uri, e);
        this.uri = uri;
    public InputStream getDataStream() {
        try { 
            return uri.toURL().openStream();
        } catch (IOException e) {
            throw new Error(e);
Connect your IDE to all the code out there  Get Codota for Java