aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2018-06-30 09:11:30 -0400
committerAndrey Loskutov2018-07-01 03:18:10 -0400
commita1d12846c9a479da6469ab6365a7fe975ecce032 (patch)
treece40ab1eff268f206204b475a579d4a28af0cb0c
parent115ca52c92444b722e852d4713e34b762e59083e (diff)
downloadeclipse.pde.build-a1d12846c9a479da6469ab6365a7fe975ecce032.zip
eclipse.pde.build-a1d12846c9a479da6469ab6365a7fe975ecce032.tar.gz
eclipse.pde.build-a1d12846c9a479da6469ab6365a7fe975ecce032.tar.xz
Change-Id: Ia15a4c451504f116aa89294c5b20a64c904ade05 Signed-off-by: Andrey Loskutov <loskutov@gmx.de> Also-by: Jiri Engelthaler <engycz@gmail.com>
-rw-r--r--org.eclipse.pde.build/src/org/eclipse/pde/internal/build/properties/PDEProperties.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/properties/PDEProperties.java b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/properties/PDEProperties.java
index 0d33efd..f2cddea 100644
--- a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/properties/PDEProperties.java
+++ b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/properties/PDEProperties.java
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2006, 2017 IBM Corporation and others.
+ * Copyright (c) 2006, 2018 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
*****************************************/
@@ -12,8 +12,7 @@ package org.eclipse.pde.internal.build.properties;
import java.io.File;
import java.io.IOException;
-import java.net.URISyntaxException;
-import java.net.URL;
+import java.net.*;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.ant.core.IAntPropertyValueProvider;
@@ -51,7 +50,14 @@ public class PDEProperties implements IAntPropertyValueProvider {
BundleHelper.getDefault().getLog().log(new Status(IStatus.ERROR, IPDEBuildConstants.PI_PDEBUILD, IPDEBuildConstants.WARNING_PLUGIN_ALTERED, NLS.bind(Messages.exception_missing_pdebuild_folder, antPropertyName), null));
} else {
try {
- result = new File(FileLocator.toFileURL(foundEntry).toURI()).getAbsolutePath();
+ URL fileURL = FileLocator.toFileURL(foundEntry);
+ URI uri = URIUtil.toURI(fileURL);
+ File file = URIUtil.toFile(uri);
+ if (file == null) {
+ BundleHelper.getDefault().getLog().log(new Status(IStatus.ERROR, IPDEBuildConstants.PI_PDEBUILD, IPDEBuildConstants.WARNING_PLUGIN_ALTERED, NLS.bind(Messages.exception_missing_pdebuild_folder, antPropertyName), null));
+ return null;
+ }
+ result = file.getAbsolutePath();
} catch (URISyntaxException e) {
BundleHelper.getDefault().getLog().log(new Status(IStatus.ERROR, IPDEBuildConstants.PI_PDEBUILD, IPDEBuildConstants.EXCEPTION_MALFORMED_URL, e.getMessage(), e));
return null;