Try a fix where the local file option is the last resort.
authorcantor <cantor@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 14 Jun 2005 18:30:14 +0000 (18:30 +0000)
committercantor <cantor@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 14 Jun 2005 18:30:14 +0000 (18:30 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@1621 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/common/ShibResource.java

index 2dc7d89..b615c2c 100755 (executable)
@@ -39,11 +39,20 @@ public class ShibResource {
        public ShibResource(String name, Class requester) throws ResourceNotAvailableException {
 
                try {
-                       resource = new URL(new URL("file:"), name);
+                       resource = new URL(name);
                } catch (MalformedURLException e) {
                        resource = requester.getResource(name);
                }
                if (resource == null) {
+                       // Try as a local file.
+                       File f = new File(name);
+                       if (f.canRead()) {
+                               try {
+                                       resource = f.toURL();
+                               }
+                               catch (MalformedURLException e) {
+                               }
+                       }
                        throw new ResourceNotAvailableException(
                                "ShibResource could not be found at the specified location: " + name);
                }