import gnu.trove.map.hash.THashMap;
public class CreateModuleAction {
- public static final String PREFIX = "reference:file:/";
+ public static final String PREFIX = "reference:file:/"; //$NON-NLS-1$
public static final void createModule(Bundle bundle, String packageName, String moduleName) throws IOException {
String bundleLocation = bundle.getLocation();
bundleLocation = bundleLocation.substring(PREFIX.length());
- Path packagePath = Paths.get(bundleLocation).resolve("scl").resolve(packageName);
+ Path packagePath = Paths.get(bundleLocation).resolve("scl").resolve(packageName); //$NON-NLS-1$
Files.createDirectories(packagePath);
- Path modulePath = packagePath.resolve(moduleName + ".scl");
+ Path modulePath = packagePath.resolve(moduleName + ".scl"); //$NON-NLS-1$
if(Files.exists(modulePath))
return;
Files.createFile(modulePath);
THashMap<String,Bundle> result = new THashMap<String,Bundle>();
for(Bundle bundle : context.getBundles()) {
String location = bundle.getLocation();
- if(location.endsWith(".jar") || !location.startsWith(PREFIX))
+ if(location.endsWith(".jar") || !location.startsWith(PREFIX)) //$NON-NLS-1$
continue;
location = location.substring(PREFIX.length());
Path bundlePath = Paths.get(location);
for(Bundle bundle : bundles.values()) {
String location = bundle.getLocation();
location = location.substring(PREFIX.length());
- Path packagePath = Paths.get(location).resolve("scl").resolve(packageName);
+ Path packagePath = Paths.get(location).resolve("scl").resolve(packageName); //$NON-NLS-1$
if(Files.exists(packagePath))
return bundle.getSymbolicName();
}
int p = packageName.lastIndexOf('/');
if(p == -1)
- return "";
+ return ""; //$NON-NLS-1$
else
return findBestPlugin(bundles, packageName.substring(0, p));
}
public static int packageMatchLength(Bundle bundle, String packageName) {
- if(bundle.getEntry("scl") == null)
+ if(bundle.getEntry("scl") == null) //$NON-NLS-1$
return 0;
- packageName = "scl/" + packageName;
+ packageName = "scl/" + packageName; //$NON-NLS-1$
while(packageName.length() > 3) {
if(bundle.getEntry(packageName) != null)
return packageName.length();