* java/net/URLClassLoader.java (FileURLLoader.getResource): File
resources should all have canonicalized names.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104360
138bc75d-0d04-0410-961f-
82ee72b054a4
+2005-09-16 Anthony Green <green@redhat.com>
+
+ PR libgcj/20198
+ * java/net/URLClassLoader.java (FileURLLoader.getResource): File
+ resources should all have canonicalized names.
+
2005-09-15 Tom Tromey <tromey@redhat.com>
PR libgcj/16032:
/** get resource with the name "name" in the file url */
Resource getResource(String name)
{
- File file = new File(dir, name);
- if (file.exists())
- return new FileResource(this, name, file);
+ try
+ {
+ File file = new File(dir, name).getCanonicalFile();
+ if (file.exists() && !file.isDirectory())
+ return new FileResource(this, file.path(), file);
+ }
+ catch (IOException e)
+ {
+ // Fall through...
+ }
return null;
}
}