title: To open file in Java/jena API
body: <p>Hi I'm currently learning semantic web on java and Jena API.
  I have an error to open a file which is in the same directory with my class</p>
  <p>My code :</p>
  <pre><code>public class Tuto7 extends Object {
  
      static final String inputFileName = &quot;vc-db-1.rdf&quot;;
  
      public static void main(String args[]) throws FileNotFoundException {
          // create an empty model
          BasicConfigurator.configure();
          Model model = ModelFactory.createDefaultModel();
  
          // use the FileManager to find the input file
          InputStream in = FileManager.get().open(inputFileName);
          System.out.println( in );
          if ( in == null) {
              throw new IllegalArgumentException(&quot;File: &quot; + inputFileName + &quot; not found&quot;);
          }
          System.out.println(&quot;After open file&quot;);
          // read the RDF/XML file
          model.read( in , &quot;&quot;);
  
          // select all the resources with a VCARD.FN property
          ResIterator iter = model.listResourcesWithProperty(VCARD.FN);
          if (iter.hasNext()) {
              System.out.println(&quot;The database contains vcards for:&quot;);
              while (iter.hasNext()) {
                  System.out.println(&quot;  &quot; + iter.nextResource()
                      .getRequiredProperty(VCARD.FN)
                      .getString());
              }
          } else {
              System.out.println(&quot;No vcards were found in the database&quot;);
          }
      }
  }
  </code></pre>
  <p>The error : <code>Exception in thread &quot;main&quot; java.lang.IllegalArgumentException: File: vc-db-1.rdf not found</code></p>
  <p>NB : The file is in the same directory</p>