harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r607324 - /harmony/enhanced/jdktools/trunk/modules/tools/src/main/java/org/apache/harmony/tools/appletviewer/HTMLParser.java
Date Fri, 28 Dec 2007 20:23:15 GMT
Author: apetrenko
Date: Fri Dec 28 12:23:14 2007
New Revision: 607324

URL: http://svn.apache.org/viewvc?rev=607324&view=rev
Log:
Applet viewer can accept file paths as parameters now

Modified:
    harmony/enhanced/jdktools/trunk/modules/tools/src/main/java/org/apache/harmony/tools/appletviewer/HTMLParser.java

Modified: harmony/enhanced/jdktools/trunk/modules/tools/src/main/java/org/apache/harmony/tools/appletviewer/HTMLParser.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/modules/tools/src/main/java/org/apache/harmony/tools/appletviewer/HTMLParser.java?rev=607324&r1=607323&r2=607324&view=diff
==============================================================================
--- harmony/enhanced/jdktools/trunk/modules/tools/src/main/java/org/apache/harmony/tools/appletviewer/HTMLParser.java
(original)
+++ harmony/enhanced/jdktools/trunk/modules/tools/src/main/java/org/apache/harmony/tools/appletviewer/HTMLParser.java
Fri Dec 28 12:23:14 2007
@@ -17,6 +17,7 @@
 
 package org.apache.harmony.tools.appletviewer;
 
+import java.io.File;
 import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URL;
@@ -46,14 +47,21 @@
 	}
 
 	private class AppletHTMLHandler extends DefaultHandler {
-		private final URL documentBase;
+		private URL documentBase;
 		private final ArrayList<AppletInfo> list;
 		private AppletInfo appletInfo = null;
 		private String startElement = null;
 		
 		public AppletHTMLHandler(String url, ArrayList<AppletInfo> list) throws MalformedURLException
{
 			super();
-			this.documentBase = new URL(url);
+			
+			// String could represent file path or URL
+			try  {
+				this.documentBase = new URL(url);
+			} catch (MalformedURLException _) {
+				File f = new File(url);
+				this.documentBase = f.toURL();
+			}
 			this.list = list;
 		}
 



Mime
View raw message