title: Absolute path to file outside of project folder with getResourceAsStream()
body: <p>I want to create jar which will read txt fom jar and then save txt file to user.home folder. When it is runned again, it will read file from user.home.</p>
  
  <p>I read file like this:</p>
  
  <pre><code>if(getClass().getResourceAsStream("/"+System.getProperty("user.home")+"/"+file_name) == null){
              configStream = getClass().getResourceAsStream(file_name);
          } else {
              configStream = getClass().getResourceAsStream(System.getProperty("user.home")+ "/"+file_name);
          }
          BufferedReader br = new BufferedReader(new InputStreamReader(configStream));
  </code></pre>
  
  <p>And then I write to file like this:</p>
  
  <pre><code>try {
          BufferedWriter out = new BufferedWriter(new FileWriter(System.getProperty("user.home")+ "/" + file_name));
          for (int j = 0; j &lt; y; j++) {
              for (int i = 0; i &lt; x; i++) {
                  if (((Block) (listArray.get(i).get(j))).getState() == blockState.blank) {
                      out.write("0");
                  } else if (((Block) (listArray.get(i).get(j))).getState() == blockState.solid) {
                      out.write("1");
                  } else if (((Block) (listArray.get(i).get(j))).getState() == blockState.player) {
                      out.write("I");
                  } else if (((Block) (listArray.get(i).get(j))).getState() == blockState.spikes) {
                      out.write("^");
                  } else if (((Block) (listArray.get(i).get(j))).getState() == blockState.water) {
                      out.write("~");
                  } else if (((Block) (listArray.get(i).get(j))).getState() == blockState.transparent) {
                      out.write("T");
                  }
              }
              out.write("\n");
          }
          out.close();
      } catch (IOException e) {
          e.printStackTrace();
      }
  </code></pre>
  
  <p>I don't know why, but program never read file from user.home, it always reads one from project folder. Where am I making a mistake? Thanks</p>