+ // New code to support outside resources:
+ if (outsideWorld != null) {
+ String pkg = this.getClass().getPackage().getName()
+ .replaceAll("\\.", File.separator)
+ + File.separator;
+
+ if (resourceName.startsWith(pkg)) {
+ try {
+ String file = outsideWorld + File.separator
+ + resourceName.substring(pkg.length());
+ stream = new FileInputStream(file);
+ } catch (Exception e) {
+ // file not in priority directory,
+ // fallback to default resource
+ }
+ }
+ }
+
+ if (stream == null)
+ stream = loader.getResourceAsStream(resourceName);
+ //