title: Reading file from classpath location for "current project"
body: <p>i have 2 projects A and B in eclipse. B has dependency to A. In project A is a text file <code>"file.txt"</code>. This file can be loaded in project B by for example <code>getClass().getResourceAsStream(...)</code>... because the location of the file is in <code>classpath</code>. I want to provide this same file name in project B and do some action only if file exists in project B. If there is no file in project B then no file should be found during loading with <code>getClass().getResourceAsStream(...)</code>. Currently the file will be always found.</p>
  
  <p>Thank you for help.</p>
  
  <p>Kind regards
  Sebastian</p>
  
  <hr>
  
  <p>I need to provide a little bit more information about the problem. Sorry.</p>
  
  <p>There is a project C which is the core. In project C there is class which do the following:</p>
  
  <ol>
  <li>Check if <code>file.txt</code> exists. This is the base code which checks only the file name. No package name. And i dont want to change it.</li>
  <li>if yes then do something.</li>
  <li>if now then do something else.</li>
  </ol>
  
  <p>A depends on C and B also depends on C. If A will be executed then the base code from C will be try to find <code>file.txt</code>. </p>
  
  <p>If B will be executed then the base code will be also try to find <code>file.txt</code>. If there is no file in B project then it will found because it is in A. I dont want it.</p>
  
  <p>Thank your very much.</p>