Code example for URI

Methods: toURL

0
 
    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 { 
            uri.toURL();
        } 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);
        } 
Stop searching for code, let great code find you!  Add Codota to your java IDE