1 package org.simantics.g3d.tools;
\r
6 import org.eclipse.core.runtime.FileLocator;
\r
7 import org.eclipse.core.runtime.IPath;
\r
8 import org.eclipse.core.runtime.Path;
\r
9 import org.osgi.framework.Bundle;
\r
11 public class PluginTools {
\r
13 public static String getAbsolutePath(Bundle inBundle, String fullpath) {
\r
14 IPath path = new Path(fullpath);
\r
15 URL u = FileLocator.find(inBundle, path, null);
\r
18 u = FileLocator.resolve(u);
\r
19 if ("file".equals(u.getProtocol())) {
\r
20 return new File(u.getFile()).getAbsolutePath();
\r
22 } catch (Exception e) {
\r