package org.simantics.audit; import java.nio.file.Path; import java.nio.file.Paths; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Platform; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; public class Activator implements BundleActivator { private static BundleContext context; private static Path logLocation; static BundleContext getContext() { return context; } /* * (non-Javadoc) * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) */ public void start(BundleContext bundleContext) throws Exception { Activator.context = bundleContext; IPath ipath = Platform.getStateLocation(getContext().getBundle()); logLocation = Paths.get(ipath.toOSString()); } /* * (non-Javadoc) * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) */ public void stop(BundleContext bundleContext) throws Exception { Activator.context = null; } public static Path getLogLocation() { return logLocation; } }