Code example for URI

Methods: getAuthoritygetScheme

0
    public void addPathToCache(String path) throws IOException {
        // Validate 
        URI pathUri = null;
        URI dfsPath = null;
        try { 
            pathUri = new URI(path);
             
            // Strip away the URI's _fragment_ and _query_ 
            dfsPath = new URI(pathUri.getScheme(), pathUri.getAuthority(), 
                              pathUri.getPath(), null, null);
        } catch (URISyntaxException urise) {
            throw new IOException("Invalid cache specification: " + path);
        } 
         
        boolean exists = false;
        try { 
            exists = FileLocalizer.fileExists(dfsPath.toString(), pigContext);
        } catch (IOException ioe) {
            // Throw a better error message... 
            throw new IOException("Invalid cache specification: '" + dfsPath + 
Stop searching for code, let great code find you!  Add Codota to your java IDE