[ http://issues.apache.org/jira/browse/IO-46?page=all ]
Stephen Colebourne updated IO-46: --------------------------------- Bugzilla Id: (was: 38523) Fix Version/s: 1.4 (was: 1.3) Moving to 1.4 as there are issues with different classloaders. Also URL formats can get weird in app servers. This needs quite a bit of thought. > [io] Find file in classpath > --------------------------- > > Key: IO-46 > URL: http://issues.apache.org/jira/browse/IO-46 > Project: Commons IO > Issue Type: Improvement > Components: Utilities > Affects Versions: 1.1 > Environment: Operating System: other > Platform: Other > Reporter: David Leal > Priority: Minor > Fix For: 1.4 > > > 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()); > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]