title: Android - java.io.FileNotFoundException open failed: ENOENT (No such file or directory)
body: <p>I'm trying code an Android app that would parse a .owl file (OWL file) and display the classes and subclasses. I keep getting the following exception when ever I try open the File.</p>
  
  <pre><code>02-22 18:48:40.421: W/System.err(535): java.io.FileNotFoundException: /Antibiotics.owl: open failed: ENOENT (No such file or directory)
  02-22 18:48:40.431: W/System.err(535):  at libcore.io.IoBridge.open(IoBridge.java:406)
  02-22 18:48:40.431: W/System.err(535):  at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:78)
  02-22 18:48:40.431: W/System.err(535):  at com.Sample.SampleApp.StartingPoint.parseOWLFile(StartingPoint.java:102)
  02-22 18:48:40.431: W/System.err(535):  at com.Sample.SampleApp.StartingPoint$3.onClick(StartingPoint.java:66)
  </code></pre>
  
  <p>Here is my Android code:</p>
  
  <pre><code>import java.io.File;
  import java.io.FileInputStream;
  import java.util.Iterator;
  
  import com.hp.hpl.jena.ontology.Individual;
  import com.hp.hpl.jena.ontology.OntClass;
  import com.hp.hpl.jena.ontology.OntModel;
  import com.hp.hpl.jena.ontology.OntModelSpec;
  import com.hp.hpl.jena.rdf.model.ModelFactory;
  import com.hp.hpl.jena.rdf.model.Resource;
  import android.support.v7.app.ActionBarActivity;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  import android.widget.EditText;
  import android.content.Intent;
  import android.os.Bundle;
  
  public class StartingPoint extends ActionBarActivity {
  
  private static final int REQUEST_PATH = 1;
  String currentFile;
  EditText et1;
  Button browse, ok, exit;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      et1 = (EditText)findViewById(R.id.editText);
  
      browse = (Button) findViewById(R.id.browseButton);
      browse.setOnClickListener(new OnClickListener(){
  
          @Override
          public void onClick(View v)
          {
              getfile(v);
          }
  
      });
  
      exit = (Button)findViewById(R.id.ExitButton);
      exit.setOnClickListener(new OnClickListener(){
  
          @Override
          public void onClick(View v)
          {
              Intent i = new Intent(Intent.ACTION_MAIN);
              i.addCategory(Intent.CATEGORY_HOME);
              i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
              startActivity(i);
          }
  
      });
  
      ok = (Button)findViewById(R.id.OKButton);
      ok.setOnClickListener(new OnClickListener(){
  
          @Override
          public void onClick(View v)
          {
              parseOWLFile();
          }
  
      });
  }
  
  public void getfile(View view)
  {
      Intent i1 = new Intent(this, FileChooser.class);
      startActivityForResult(i1, REQUEST_PATH);
  }
  
  protected void onActivityResult(int requestCode, int resultCode, Intent data)
  {
      if(requestCode == REQUEST_PATH)
      {
          if(resultCode == RESULT_OK)
          {
              currentFile = data.getStringExtra("GetFileName");
              et1.setText(currentFile);
          }
      }
  }
  
  public void parseOWLFile()
  {
      //String file = et1.getText().toString(); //Uncomment this when using on phone/tablet
  
      String file = "Antibiotics.owl";
  
      try
      {
          //System.out.println("File name is "+file);
  
          File f = new File(file);
          System.out.println("File name is "+f.toString());
          FileInputStream fis = new FileInputStream(f);
  
          OntModel base = ModelFactory.createOntologyModel( OntModelSpec.OWL_DL_MEM );
          base.read(fis, null);
  
          String ns = base.getNsPrefixURI("Ontology");
  
          Resource r = base.getResource(ns+" Concept");
          OntClass theClass = r.as(OntClass.class);
  
          Individual indiv = base.createIndividual(ns+"IndivTest", theClass);
  
          for (Iterator&lt;Resource&gt; i = indiv.listRDFTypes(true); i.hasNext(); )
              System.out.println( indiv.getURI() + " is asserted in class " + i.next() );
  
          OntModel inf = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM_MICRO_RULE_INF, base );
  
          Individual ind = inf.getIndividual( ns + "indivTest" );
          for (Iterator&lt;Resource&gt; i = ind.listRDFTypes(true); i.hasNext(); )
              System.out.println( ind.getURI() + " is inferred to be in class " + i.next() );
  
  
  
      }
      catch(Exception e)
      {
          e.printStackTrace();
      }
  }
  
  }
  </code></pre>
  
  <p>I have the file "Antibiotics.owl" in the parent directory of the Project. I'm running the Project on an emulator.</p>
  
  <p>How can I get rid of this exception and parse the OWL file? I'm still a beginner in Android programming.</p>