aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaphael <raphael@google.com>2010-03-31 16:25:10 -0700
committerRaphael <raphael@google.com>2010-03-31 17:27:38 -0700
commit033a85dd05a72c2017c00eedf94c97169de58c06 (patch)
tree43cc01f4c8341e3fb84d14a6d7943bb3e938adfd
parent94049bef1ac2fc28fb56544eed6d1f3b58d6c0dd (diff)
downloadsdk-033a85dd05a72c2017c00eedf94c97169de58c06.zip
sdk-033a85dd05a72c2017c00eedf94c97169de58c06.tar.gz
sdk-033a85dd05a72c2017c00eedf94c97169de58c06.tar.bz2
ADT NPW and GLE: fix AdtPlugin.getEmbeddedFileUrl
The method was always adding an initial slash to the path. This is only needed if the requested path doesn't have one. This fixes the NPW templates and the GLE scripts usage. SDK Bug: 2546962 Change-Id: If19eb0a5b931eeb1d160c980f950eb0a974246e8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java
index d10b981..a9336b2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java
@@ -580,16 +580,21 @@ public class AdtPlugin extends AbstractUIPlugin {
if (sPlugin != null) {
bundle = sPlugin.getBundle();
} else {
+ AdtPlugin.log(IStatus.WARNING, "ADT Plugin is missing"); //$NON-NLS-1$
return null;
}
}
// attempt to get a file to one of the template.
- String path = AndroidConstants.WS_SEP + filepath;
+ String path = filepath;
+ if (!path.startsWith(AndroidConstants.WS_SEP)) {
+ path = AndroidConstants.WS_SEP + path;
+ }
+
URL url = bundle.getEntry(path);
if (url == null) {
- AdtPlugin.log(IStatus.INFO, "Bundle file URL not found at path '%s'", path);
+ AdtPlugin.log(IStatus.INFO, "Bundle file URL not found at path '%s'", path); //$NON-NLS-1$
}
return url;