From: <mwl...@us...> - 2008-09-05 18:59:57
|
Revision: 806 http://cishell.svn.sourceforge.net/cishell/?rev=806&view=rev Author: mwlinnem Date: 2008-09-05 18:59:54 +0000 (Fri, 05 Sep 2008) Log Message: ----------- New version using a URL instead of a URI. Makes it work on Hanning's computer. We'll see if it works elsewhere. Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/MenuAdapter.java Modified: trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/MenuAdapter.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/MenuAdapter.java 2008-09-04 21:08:59 UTC (rev 805) +++ trunk/clients/gui/org.cishell.reference.gui.menumanager/src/org/cishell/reference/gui/menumanager/menu/MenuAdapter.java 2008-09-05 18:59:54 UTC (rev 806) @@ -15,8 +15,8 @@ import java.io.File; import java.io.IOException; -import java.net.URI; import java.net.URISyntaxException; +import java.net.URL; import java.util.HashMap; import java.util.Map; @@ -159,15 +159,15 @@ System.err.println(">>>app_location = "+app_location); String fileFullPath = app_location + DEFAULT_MENU_FILE_NAME; System.err.println(">>>fileFullPath = " + fileFullPath); - URI configurationDirectoryURI = new URI(fileFullPath); - System.err.println(">>>URI = " + configurationDirectoryURI.toString()); - System.err.println(">>> file at URI = " + new File(configurationDirectoryURI).toString()); - if (new File(configurationDirectoryURI).exists()) { + URL configurationDirectoryURL = new URL(fileFullPath); + System.err.println(">>>URL = " + configurationDirectoryURL.toString()); + try { + configurationDirectoryURL.getContent(); System.out.println(">>>config.ini Exists!"); createMenuFromXML(fileFullPath); processLeftServiceBundles(); - - } else { + } catch (IOException e) { + e.printStackTrace(); System.err.println("config.ini does not exist... Reverting to backup plan"); initializeMenu(); } @@ -175,8 +175,6 @@ } catch (InvalidSyntaxException e) { getLog().log(LogService.LOG_DEBUG, "Invalid Syntax", e); - } catch (URISyntaxException e) { - getLog().log(LogService.LOG_DEBUG, "Invalid Syntax", e); } catch (Throwable e) { //Should catch absolutely everything catchable. Will hopefully reveal the error coming out of the URI constructor. //No time to test today, just commiting this for testing later. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |