title: Reading file from PATH of URI
body: <p>I have to read a file which can be local or in remote.<br>
  The file path or <code>URI</code> will come form user input.<br>
  Currently I am reading only local file,this way</p>
  
  <pre><code>public String readFile(String fileName)
  {
  
      File file=new File(fileName);
      BufferedReader bufferedReader = null;
      try {
          bufferedReader = new BufferedReader(new FileReader(file));
          StringBuilder stringBuilder = new StringBuilder();
          String line;
  
          while ( (line=bufferedReader.readLine())!=null ) {
              stringBuilder.append(line);
              stringBuilder.append(System.lineSeparator());
          }
          return stringBuilder.toString();
      } catch (FileNotFoundException e) {
          System.err.println("File : \""+file.getAbsolutePath()+"\" Not found");
          e.printStackTrace();
      } catch (IOException e) {
          e.printStackTrace();
      }
      finally {
          try {
              bufferedReader.close();
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
      return null;
  }
  </code></pre>
  
  <p>The parameter <code>String fileName</code> is the user input which can be a path to local file or a <code>URI</code><br>
  How can i modify this method to work with both <code>Local path</code> and <code>URI</code> ?</p>