package fi.vtt.simantics.procore.internal; import java.io.File; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Platform; import org.osgi.framework.Bundle; public class Utils { public static File getBaseFile(Bundle b) { if(Platform.isRunning()) { IPath state = Platform.getStateLocation(b); return state.append("debug").toFile(); } else { return new File(""); } } public static long convertHexStringToLong(String hex) { if (hex.length() < 16) return Long.parseLong(hex, 16); long f = Long.parseLong(hex.substring(0,1), 16) << 60; long l = Long.parseLong(hex.substring(1,16), 16); return f | l; } }