title: Exception in thread "main" java.lang.IllegalArgumentException: URI is not hierar chical
body: <p>I have seen similar questions but not sure how to fix it. I have tried changing it to input stream</p>
  
  <pre><code>public List&lt;String&gt; mergeInputData(List&lt;String&gt; s){
  
      List&lt;String&gt; mergedInputData = new ArrayList&lt;String&gt;();
      for (String string : s) {
          Enumeration&lt;URL&gt; en = getClass().getClassLoader().getResources(
                  string);
          if (en.hasMoreElements()) {
              URL metaInf = en.nextElement();
              try (BufferedReader br = new BufferedReader(new FileReader(
                      new File(metaInf.toURI())))) {
                  String line = "";
                  while ((line = br.readLine()) != null) {
                      if (line.length() &gt; 0)
                          mergedInputData.add(line.trim());
                  }
              } catch (URISyntaxException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              }
  
          }
      }
  
      return mergedInputData;
  }
  </code></pre>
  
  <p>Above, string just contains the name of the file (say egample.txt)For eg am trying to read egample.txt.</p>
  
  <p>It runs from eclipse though. Please suggest how can i fix it.I have gone through other answers but not sure. </p>
  
  <p><a href="https://i.stack.imgur.com/k2cFJ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/k2cFJ.jpg" alt="folder structure"></a></p>