X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.g3d%2Fsrc%2Forg%2Fsimantics%2Fg3d%2Ftools%2FPluginTools.java;h=296f1a1142545cbe7516aaa56af21c4bc831b270;hb=refs%2Fchanges%2F28%2F3328%2F1;hp=d20fa85af5442c953b27d24ecc465694ddfd98da;hpb=87b3241ec277ba3d8e414b26186a032c9cdcaeed;p=simantics%2F3d.git diff --git a/org.simantics.g3d/src/org/simantics/g3d/tools/PluginTools.java b/org.simantics.g3d/src/org/simantics/g3d/tools/PluginTools.java index d20fa85a..296f1a11 100644 --- a/org.simantics.g3d/src/org/simantics/g3d/tools/PluginTools.java +++ b/org.simantics.g3d/src/org/simantics/g3d/tools/PluginTools.java @@ -1,3 +1,14 @@ +/******************************************************************************* + * Copyright (c) 2012, 2013 Association for Decentralized Information Management in + * Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ package org.simantics.g3d.tools; import java.io.File; @@ -10,19 +21,19 @@ 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; - } + 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; + } }