Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 102895 Details for
Bug 207103
[prov] Ensure UNC path are supported
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
simpleconfigurator patch 2
207103_simpleconfigurator.txt (text/plain), 7.00 KB, created by
Thomas Watson
on 2008-05-30 12:00:13 EDT
(
hide
)
Description:
simpleconfigurator patch 2
Filename:
MIME Type:
Creator:
Thomas Watson
Created:
2008-05-30 12:00:13 EDT
Size:
7.00 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.simpleconfigurator >Index: src/org/eclipse/equinox/internal/simpleconfigurator/SimpleConfiguratorImpl.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/SimpleConfiguratorImpl.java,v >retrieving revision 1.5 >diff -u -r1.5 SimpleConfiguratorImpl.java >--- src/org/eclipse/equinox/internal/simpleconfigurator/SimpleConfiguratorImpl.java 9 May 2008 19:03:54 -0000 1.5 >+++ src/org/eclipse/equinox/internal/simpleconfigurator/SimpleConfiguratorImpl.java 30 May 2008 15:48:20 -0000 >@@ -65,8 +65,9 @@ > URL url = null; > String file = specifiedURL; > while (!done) { >+ // TODO what is this while loop for? nested file:file:file: urls? > try { >- url = new URL(file); >+ url = Utils.buildURL(file); > file = url.getFile(); > } catch (java.net.MalformedURLException e) { > done = true; >@@ -97,7 +98,7 @@ > > //Last resort > try { >- return new URL(specifiedURL); >+ return Utils.buildURL(specifiedURL); > } catch (MalformedURLException e) { > //Ignore > } >Index: src/org/eclipse/equinox/internal/simpleconfigurator/utils/Utils.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/Utils.java,v >retrieving revision 1.9 >diff -u -r1.9 Utils.java >--- src/org/eclipse/equinox/internal/simpleconfigurator/utils/Utils.java 11 Feb 2008 06:16:04 -0000 1.9 >+++ src/org/eclipse/equinox/internal/simpleconfigurator/utils/Utils.java 30 May 2008 15:48:20 -0000 >@@ -1,12 +1,10 @@ > /******************************************************************************* >- * Copyright (c) 2007, 2008 IBM Corporation and others. >- * All rights reserved. This program and the accompanying materials >- * are made available under the terms of the Eclipse Public License v1.0 >- * which accompanies this distribution, and is available at >- * http://www.eclipse.org/legal/epl-v10.html >- * >- * Contributors: >- * IBM Corporation - initial API and implementation >+ * Copyright (c) 2007, 2008 IBM Corporation and others. All rights reserved. >+ * This program and the accompanying materials are made available under the >+ * terms of the Eclipse Public License v1.0 which accompanies this distribution, >+ * and is available at http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: IBM Corporation - initial API and implementation > *******************************************************************************/ > package org.eclipse.equinox.internal.simpleconfigurator.utils; > >@@ -18,14 +16,12 @@ > import java.util.zip.ZipFile; > import org.eclipse.equinox.internal.simpleconfigurator.Activator; > >-/** >- * This class was copied from >- * org.eclipse.equinox.internal.frameworkadmin.utils package of >- * org.eclipse.equinox.frameworkadmin plugin on March 3 2007. >- * >- * The reason why it was copied is to make simpleconfigurator dependent on >- * any bundles(org.eclipse.equinox.framework). >+/* >+ * This class was copied from org.eclipse.equinox.internal.frameworkadmin.utils >+ * package of org.eclipse.equinox.frameworkadmin plugin on March 3 2007. > * >+ * The reason why it was copied is to make simpleconfigurator dependent on any >+ * bundles(org.eclipse.equinox.framework). > */ > > public class Utils { >@@ -169,9 +165,9 @@ > String fromSt = Utils.removeLastCh(from.toExternalForm(), '/'); > if (path.startsWith("/")) { > String fileSt = from.getFile(); >- return new URL(fromSt.substring(0, fromSt.lastIndexOf(fileSt) - 1) + path); >+ return Utils.buildURL(fromSt.substring(0, fromSt.lastIndexOf(fileSt) - 1) + path); > } >- return new URL(fromSt + "/" + path); >+ return Utils.buildURL(fromSt + "/" + path); > } > > public static String removeLastCh(String target, char ch) { >@@ -221,4 +217,17 @@ > e.printStackTrace(); > // } > } >+ >+ public static URL buildURL(String spec) throws MalformedURLException { >+ if (spec == null) >+ throw new NullPointerException("URL spec is null."); //$NON-NLS-1$ >+ // Construct the URL carefully so as to preserve UNC paths etc. >+ if (spec.startsWith("file:")) { //$NON-NLS-1$ >+ // need to do this for UNC paths >+ File file = new File(spec.substring(5)); >+ if (file.isAbsolute()) >+ return file.toURL(); >+ } >+ return new URL(spec); >+ } > } >Index: src/org/eclipse/equinox/internal/simpleconfigurator/utils/SimpleConfiguratorUtils.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/utils/SimpleConfiguratorUtils.java,v >retrieving revision 1.5 >diff -u -r1.5 SimpleConfiguratorUtils.java >--- src/org/eclipse/equinox/internal/simpleconfigurator/utils/SimpleConfiguratorUtils.java 29 Nov 2007 21:52:29 -0000 1.5 >+++ src/org/eclipse/equinox/internal/simpleconfigurator/utils/SimpleConfiguratorUtils.java 30 May 2008 15:48:20 -0000 >@@ -60,7 +60,7 @@ > } else > tok.nextToken(); // , > try { >- new URL(urlSt); >+ Utils.buildURL(urlSt); > } catch (MalformedURLException e) { > urlSt = Utils.getUrlInFull(urlSt, baseUrl).toExternalForm(); > } >@@ -70,7 +70,7 @@ > boolean markedAsStarted = Boolean.valueOf(tok.nextToken()).booleanValue(); > // URL urlBundle = null; > // try { >- // urlBundle = new URL(urlSt); >+ // urlBundle = Utils.buildURL(urlSt); > // } catch (MalformedURLException e) { > // urlBundle = Utils.getFullUrl(urlSt, baseUrl); > // } >Index: src/org/eclipse/equinox/internal/simpleconfigurator/console/ConfiguratorCommandProvider.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/console/ConfiguratorCommandProvider.java,v >retrieving revision 1.4 >diff -u -r1.4 ConfiguratorCommandProvider.java >--- src/org/eclipse/equinox/internal/simpleconfigurator/console/ConfiguratorCommandProvider.java 29 Nov 2007 22:15:09 -0000 1.4 >+++ src/org/eclipse/equinox/internal/simpleconfigurator/console/ConfiguratorCommandProvider.java 30 May 2008 15:48:20 -0000 >@@ -10,6 +10,7 @@ > > import java.net.MalformedURLException; > import java.net.URL; >+import org.eclipse.equinox.internal.simpleconfigurator.utils.Utils; > import org.eclipse.osgi.framework.console.CommandInterpreter; > import org.eclipse.osgi.framework.console.CommandProvider; > import org.osgi.framework.BundleContext; >@@ -29,7 +30,7 @@ > */ > private URL toURL(CommandInterpreter interpreter, String urlString) { > try { >- return new URL(urlString); >+ return Utils.buildURL(urlString); > } catch (MalformedURLException e) { > interpreter.println(e.getMessage()); > return null;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 207103
:
101600
|
101816
|
101818
|
101821
| 102895 |
102898
|
102899
|
103577