1
1
/*******************************************************************************
2
- * Copyright (c) 2009, 2013 Wind River Systems and others.
2
+ * Copyright (c) 2009, 2025 Wind River Systems and others.
3
3
*
4
4
* This program and the accompanying materials
5
5
* are made available under the terms of the Eclipse Public License 2.0
24
24
import org .eclipse .core .resources .ResourcesPlugin ;
25
25
import org .eclipse .core .runtime .CoreException ;
26
26
import org .eclipse .core .runtime .FileLocator ;
27
- import org .eclipse .core .runtime .IPath ;
28
27
import org .osgi .framework .Bundle ;
29
28
import org .osgi .framework .FrameworkUtil ;
30
29
@@ -38,15 +37,17 @@ public class TestsPlugin {
38
37
public static final String PLUGIN_ID = "org.eclipse.debug.tests" ; //$NON-NLS-1$
39
38
40
39
/**
41
- * Returns the file corresponding to the specified path from within this bundle
42
- * @return the file corresponding to the specified path from within this bundle, or
43
- * <code>null</code> if not found
40
+ * Returns the file corresponding to the specified path from within this
41
+ * bundle
42
+ *
43
+ * @return the file corresponding to the specified path from within this
44
+ * bundle, or <code>null</code> if not found
44
45
*/
45
- public static File getFileInPlugin (IPath path ) {
46
+ public static File getFileInPlugin (String path ) {
46
47
try {
47
48
Bundle bundle = FrameworkUtil .getBundle (TestsPlugin .class );
48
- URL installURL = new URL ( bundle .getEntry ("/" ), path . toString () ); //$NON-NLS-1$
49
- URL localURL = FileLocator .toFileURL ( installURL ); //Platform.asLocalURL (installURL);
49
+ URL installURL = bundle .getEntry ("/" + path ); //$NON-NLS-1$
50
+ URL localURL = FileLocator .toFileURL (installURL );
50
51
return new File (localURL .getFile ());
51
52
} catch (IOException e ) {
52
53
return null ;
@@ -55,6 +56,7 @@ public static File getFileInPlugin(IPath path) {
55
56
56
57
/**
57
58
* Creates a new project with the specified name
59
+ *
58
60
* @return a new project with the specified name
59
61
*/
60
62
public static IProject createProject (String projectName ) throws CoreException {
0 commit comments