title: Java FileNotFoundException
body: <p>This is probably something incredibly dumb on my part, but I've been fighting with it for an hour.</p>
  
  <p>Given these classes, all in the same package:</p>
  
  <ul>
  <li>ParsingClass.java</li>
  <li>CatalogHandler.java (extends DefaultHandler, adds a ConfigMap field)</li>
  <li>hd.xml</li>
  </ul>
  
  <p>Since the class and the XML are in the same package, I didn't expect to have to fight to find the XML file. Unfortunately, the best laid plans often go awry.</p>
  
  <pre><code>private static Map&lt;String, Object&gt; parseCatalogXml(String catalogName) {
  
      SAXParserFactory factory = SAXParserFactory.newInstance();
  
      CatalogHandler handler = new CatalogHandler();
  
      try {
          SAXParser parser = factory.newSAXParser();
          File file = new File(catalogName + ".xml");
          if (!file.exists()) {
              throw new IllegalStateException("Unable to find file: " + file.getName());
          }
          parser.parse(file, handler);
      } catch (SAXException ex) {
  
      } catch (ParserConfigurationException ex) {
  
      } catch (IOException ex) {
  
      }
  
      return handler.getConfigMap();
  
  }
  </code></pre>
  
  <p>Using new File("").getAbsolutePath() didn't work from either the IDE or using maven on the command line.</p>