Code example for URI

Methods: getPath

    private BufferedReader openRegularFile(URI filename)
            throws DataSourceException { 
        FileInputStream stream;
        try { 
            stream = new FileInputStream(filename.getPath());
        } catch(FileNotFoundException e) {
            throw new DataSourceException( 
                "Couldn't open the trace file " + filename, e);
        return readerForStream(stream);
    private BufferedReader readerForStream(InputStream stream) {
        DataInputStream dataStream = new DataInputStream(stream);
        return new BufferedReader(new InputStreamReader(dataStream));
    private BufferedReader openFile(URI filename)
Experience pair programming with AI  Get Codota for Java