+/*******************************************************************************\r
+ * Copyright (c) 2012, 2013 Association for Decentralized Information Management in\r
+ * Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
package org.simantics.g3d.tools;\r
\r
import java.io.File;\r
\r
public class PluginTools {\r
\r
- public static String getAbsolutePath(Bundle inBundle, String fullpath) {\r
- IPath path = new Path(fullpath);\r
- URL u = FileLocator.find(inBundle, path, null);\r
- if (u != null) {\r
- try {\r
- u = FileLocator.resolve(u);\r
- if ("file".equals(u.getProtocol())) {\r
- return new File(u.getFile()).getAbsolutePath();\r
- }\r
- } catch (Exception e) {\r
- }\r
- }\r
- return null;\r
- }\r
+ public static String getAbsolutePath(Bundle inBundle, String fullpath) {\r
+ IPath path = new Path(fullpath);\r
+ URL u = FileLocator.find(inBundle, path, null);\r
+ if (u != null) {\r
+ try {\r
+ u = FileLocator.resolve(u);\r
+ if ("file".equals(u.getProtocol())) {\r
+ return new File(u.getFile()).getAbsolutePath();\r
+ }\r
+ } catch (Exception e) {\r
+ }\r
+ }\r
+ return null;\r
+ }\r
\r
}\r