diff core/src/luan/modules/Utils.java @ 216:a1b142f9c5c0

make Utils.toUrl() check for "index.html" or "index.html.luan" in dirs for jars (hack) git-svn-id: https://luan-java.googlecode.com/svn/trunk@217 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Mon, 14 Jul 2014 06:11:55 +0000
parents 99eef1d0e706
children f9e3e64132e1
line wrap: on
line diff
--- a/core/src/luan/modules/Utils.java	Fri Jul 11 23:13:15 2014 +0000
+++ b/core/src/luan/modules/Utils.java	Mon Jul 14 06:11:55 2014 +0000
@@ -75,6 +75,18 @@
 			if( path.contains("//") )
 				return null;
 			URL url = ClassLoader.getSystemResource(path);
+			if( url==null && path.endsWith("/") ) {
+				url = ClassLoader.getSystemResource(path+"index.html");
+				if( url==null )
+					url = ClassLoader.getSystemResource(path+"index.html.luan");
+				if( url != null ) {
+					try {
+						url = new URL(url,".");
+					} catch(MalformedURLException e) {
+						throw new RuntimeException(e);
+					}
+				}
+			}
 			return url==null ? null : url;
 		}
 		try {