1 /*******************************************************************************
2 * Copyright (c) 2016 École Polytechnique de Montréal
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *******************************************************************************/
10 package org
.eclipse
.tracecompass
.lttng2
.common
.core
.tests
;
12 import java
.io
.IOException
;
15 import org
.eclipse
.core
.runtime
.FileLocator
;
16 import org
.eclipse
.core
.runtime
.IPath
;
17 import org
.eclipse
.core
.runtime
.Path
;
18 import org
.eclipse
.core
.runtime
.Plugin
;
19 import org
.osgi
.framework
.BundleContext
;
22 * Activator for the lttng2.common.core.tests plugin
24 * @author Geneviève Bastien
26 public class Activator
extends Plugin
{
27 // ------------------------------------------------------------------------
29 // ------------------------------------------------------------------------
34 public static final String PLUGIN_ID
= "org.eclipse.tracecompass.lttng2.common.core.tests"; //$NON-NLS-1$
39 private static Activator PLUGIN
;
41 // ------------------------------------------------------------------------
43 // ------------------------------------------------------------------------
51 // ------------------------------------------------------------------------
53 // ------------------------------------------------------------------------
56 * Returns the shared instance
58 * @return the shared instance
60 public static Activator
getDefault() {
64 // ------------------------------------------------------------------------
66 // ------------------------------------------------------------------------
69 public void start(BundleContext context
) throws Exception
{
75 public void stop(BundleContext context
) throws Exception
{
81 * Return a path to a file relative to this plugin's base directory
84 * The path relative to the plugin's root directory
85 * @return The path corresponding to the relative path in parameter
87 public static IPath
getAbsoluteFilePath(String relativePath
) {
88 Activator plugin
= Activator
.getDefault();
91 * Shouldn't happen but at least throw something to get the test to
94 throw new IllegalStateException();
96 URL location
= FileLocator
.find(plugin
.getBundle(), new Path(relativePath
), null);
98 return new Path(FileLocator
.toFileURL(location
).getPath());
99 } catch (IOException e
) {
100 throw new IllegalStateException();
This page took 0.0322 seconds and 5 git commands to generate.