blob: 410c584e0290edfc183b47271c3d8510a07d13ba (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
/*******************************************************************************
* Copyright (c) 2000, 2009 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.ui.tests.refactoring.infra;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
public class RefactoringTestPlugin extends Plugin {
private static RefactoringTestPlugin fgDefault;
public RefactoringTestPlugin() {
fgDefault= this;
}
public static RefactoringTestPlugin getDefault() {
return fgDefault;
}
public static IWorkspace getWorkspace() {
return ResourcesPlugin.getWorkspace();
}
public InputStream getTestResourceStream(String fileName) throws IOException {
IPath path= new Path("resources").append(fileName);
URL url= new URL(getBundle().getEntry("/"), path.toString());
return url.openStream();
}
}
|