[libbluray-devel] Covert backslashes to slashes in BDJClassLoader

tourettes git at videolan.org
Tue Mar 18 20:43:38 CET 2014


libbluray | branch: master | tourettes <tourettes at team-mediaportal.com> | Mon Mar 17 22:05:57 2014 +0200| [fe6eba03b5f420ffe69e9b87bf563ed033a18361] | committer: hpi1

Covert backslashes to slashes in BDJClassLoader

This will fix resource loading issues with some disks in Windows based players.

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=fe6eba03b5f420ffe69e9b87bf563ed033a18361
---

 .../bdj/java/org/videolan/BDJClassLoader.java      |   29 ++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/src/libbluray/bdj/java/org/videolan/BDJClassLoader.java b/src/libbluray/bdj/java/org/videolan/BDJClassLoader.java
index e7385aa..361c231 100644
--- a/src/libbluray/bdj/java/org/videolan/BDJClassLoader.java
+++ b/src/libbluray/bdj/java/org/videolan/BDJClassLoader.java
@@ -20,9 +20,13 @@
 package org.videolan;
 
 import java.net.MalformedURLException;
+
+import java.io.InputStream;
+import java.io.IOException;
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.util.ArrayList;
+import java.util.Enumeration;;
 
 import javax.tv.xlet.Xlet;
 
@@ -122,5 +126,30 @@ public class BDJClassLoader extends URLClassLoader {
         return super.loadClass(name);
     }
 
+    public URL getResource(String name) {
+        name = name.replace('\\', '/');
+        return super.getResource(name);
+    }
+
+    public Enumeration getResources(String name) throws IOException {
+        name = name.replace('\\', '/');
+        return super.getResources(name);
+    }
+
+    public URL findResource(String name) {
+        name = name.replace('\\', '/');
+        return super.findResource(name);
+    }
+
+    public Enumeration findResources(String name) throws IOException {
+        name = name.replace('\\', '/');
+        return super.findResources(name);
+    }
+
+    public InputStream getResourceAsStream(String name) {
+        name = name.replace('\\', '/');
+        return super.getResourceAsStream(name);
+    }
+
     private String xletClass;
 }



More information about the libbluray-devel mailing list