package org.simantics.g3d.tools; import java.io.File; import java.net.URL; import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; import org.osgi.framework.Bundle; public class PluginTools { public static String getAbsolutePath(Bundle inBundle, String fullpath) { IPath path = new Path(fullpath); URL u = FileLocator.find(inBundle, path, null); if (u != null) { try { u = FileLocator.resolve(u); if ("file".equals(u.getProtocol())) { return new File(u.getFile()).getAbsolutePath(); } } catch (Exception e) { } } return null; } }