Uploaded image for project: 'Commons IO'
  1. Commons IO
  2. IO-46

[io] Find file in classpath

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • Utilities
    • None
    • Operating System: other
      Platform: Other

    • 38523

    Description

      Just to suggest adding a method like this:
      public File findFileInClasspath(String fileName) throws FileNotFoundException
      {
      URL url = getClass().getClassLoader().getResource(fileName);
      if (url == null)

      { throw new FileNotFoundException(fileName); }

      return new File(url.getFile());
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            achepati67@yahoo.es David Leal
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: