Skip to content

Commit

Permalink
for URLResource do not try to find directory for certain pathnames
Browse files Browse the repository at this point in the history
all the pathnames ending in ".rb", ".class", ".jar" assume they are
files and do no lookup directory info.
  • Loading branch information
mkristian committed Dec 1, 2014
1 parent a65a63c commit 22331c2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/src/main/java/org/jruby/util/URLResource.java
Expand Up @@ -252,6 +252,9 @@ private static String[] listFilesFromInputStream(InputStream is) {
}
}
private static String[] listClassLoaderFiles(String pathname) {
if (pathname.endsWith(".rb") || pathname.endsWith(".class") || pathname.endsWith(".jar")) {
return null;
}
try
{
Enumeration<URL> urls = Thread.currentThread().getContextClassLoader().getResources(pathname + "/.jrubydir");
Expand All @@ -276,6 +279,9 @@ private static String[] listClassLoaderFiles(String pathname) {
}

private static String[] listFiles(String pathname) {
if (pathname.endsWith(".rb") || pathname.endsWith(".class") || pathname.endsWith(".jar")) {
return null;
}
try
{
// TODO remove this replace
Expand Down

0 comments on commit 22331c2

Please sign in to comment.