Code example for URI

Methods: isAbsolutetoURL

0
        } 
 
        URI uri; 
        try 
        { 
            uri = new URI( targetPath ); 
            uri.toURL(); // check protocol 
        } 
        catch ( Exception e ) 
        { 
            uri = null; 
        } 
 
        // fall-back to file-system approach 
        if ( null == uri || !uri.isAbsolute() ) 
        { 
            uri = new File( targetPath ).toURI(); 
        } 
 
        return uri; 
Stop searching for code, let great code find you!  Add Codota to your java IDE