summaryrefslogtreecommitdiff
path: root/org.tizen.common
diff options
context:
space:
mode:
Diffstat (limited to 'org.tizen.common')
-rw-r--r--org.tizen.common/src/org/tizen/common/util/PluginUtil.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/org.tizen.common/src/org/tizen/common/util/PluginUtil.java b/org.tizen.common/src/org/tizen/common/util/PluginUtil.java
index e542706ef..02c7584eb 100644
--- a/org.tizen.common/src/org/tizen/common/util/PluginUtil.java
+++ b/org.tizen.common/src/org/tizen/common/util/PluginUtil.java
@@ -26,10 +26,13 @@
package org.tizen.common.util;
+import java.io.IOException;
import java.net.URI;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
+
+import org.eclipse.core.internal.runtime.Activator;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IConfigurationElement;
@@ -37,6 +40,7 @@ import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.URIUtil;
import org.tizen.common.Surrogate;
@@ -138,4 +142,12 @@ public class PluginUtil {
sourceURI = URIUtil.toURI( sourceURL );
return (null == sourceURI) ? null : sourceURI.getPath();
}
+
+ public static URL getBuiltInURL(Plugin plugin, String entryPath) throws IOException {
+ Assert.notNull( plugin );
+ Assert.notNull( entryPath );
+
+ URL entry = plugin.getBundle().getEntry( entryPath );
+ return ( entry != null ) ? FileLocator.toFileURL( entry ) : null;
+ }
}