本文整理汇总了Java中org.eclipse.jdt.internal.compiler.batch.FileSystem.Classpath方法的典型用法代码示例。如果您正苦于以下问题:Java FileSystem.Classpath方法的具体用法?Java FileSystem.Classpath怎么用?Java FileSystem.Classpath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.internal.compiler.batch.FileSystem
的用法示例。
在下文中一共展示了FileSystem.Classpath方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPathsFrom
import org.eclipse.jdt.internal.compiler.batch.FileSystem; //导入方法依赖的package包/类
private Iterable<? extends File> getPathsFrom(String path) {
ArrayList<FileSystem.Classpath> paths = new ArrayList<FileSystem.Classpath>();
ArrayList<File> files = new ArrayList<File>();
try {
this.processPathEntries(Main.DEFAULT_SIZE_CLASSPATH, paths, path, this.charset.name(), false, false);
} catch (IllegalArgumentException e) {
return null;
}
for (FileSystem.Classpath classpath : paths) {
files.add(new File(classpath.getPath()));
}
return files;
}
示例2: getEndorsedDirsFrom
import org.eclipse.jdt.internal.compiler.batch.FileSystem; //导入方法依赖的package包/类
private Iterable<? extends File> getEndorsedDirsFrom(String path) {
ArrayList<FileSystem.Classpath> paths = new ArrayList<FileSystem.Classpath>();
ArrayList<File> files = new ArrayList<File>();
try {
this.processPathEntries(Main.DEFAULT_SIZE_CLASSPATH, paths, path, this.charset.name(), false, false);
} catch (IllegalArgumentException e) {
return null;
}
for (FileSystem.Classpath classpath : paths) {
files.add(new File(classpath.getPath()));
}
return files;
}
示例3: getExtdirsFrom
import org.eclipse.jdt.internal.compiler.batch.FileSystem; //导入方法依赖的package包/类
private Iterable<? extends File> getExtdirsFrom(String path) {
ArrayList<FileSystem.Classpath> paths = new ArrayList<FileSystem.Classpath>();
ArrayList<File> files = new ArrayList<File>();
try {
this.processPathEntries(Main.DEFAULT_SIZE_CLASSPATH, paths, path, this.charset.name(), false, false);
} catch (IllegalArgumentException e) {
return null;
}
for (FileSystem.Classpath classpath : paths) {
files.add(new File(classpath.getPath()));
}
return files;
}
示例4: NameEnv
import org.eclipse.jdt.internal.compiler.batch.FileSystem; //导入方法依赖的package包/类
public NameEnv(Map<String, String> files, Map<String, byte[]> classpath) {
this.files = files;
this.classpath = classpath;
packagesCache = new HashSet<String>();
Set<String> allFiles = new HashSet<String>();
allFiles.addAll(files.keySet());
allFiles.addAll(classpath.keySet());
for (String path : allFiles) {
while (!path.isEmpty()) {
path = FilenameUtils.getPath(path).replaceFirst("/$", "");
String pkg = path.replace("/", ".");
if (packagesCache.contains(pkg)) {
break;
} else {
packagesCache.add(pkg);
}
}
}
ArrayList<FileSystem.Classpath> cp = new ArrayList<FileSystem.Classpath>();
ArrayList<String> cps = new ArrayList<String>();
collectRunningVMBootclasspath(cp);
for (FileSystem.Classpath classpath1 : cp) {
cps.add(classpath1.getPath());
}
fileSystem = new FileSystem(cps.toArray(new String[cps.size()]), null, null);
}
示例5: collectRunningVMBootclasspath
import org.eclipse.jdt.internal.compiler.batch.FileSystem; //导入方法依赖的package包/类
public static void collectRunningVMBootclasspath(List bootclasspaths) {
/* no bootclasspath specified
* we can try to retrieve the default librairies of the VM used to run
* the batch compiler
*/
String javaversion = System.getProperty("java.version");//$NON-NLS-1$
if (javaversion != null && javaversion.equalsIgnoreCase("1.1.8")) { //$NON-NLS-1$
throw new IllegalStateException();
}
/*
* Handle >= JDK 1.2.2 settings: retrieve the bootclasspath
*/
// check bootclasspath properties for Sun, JRockit and Harmony VMs
String bootclasspathProperty = System.getProperty("sun.boot.class.path"); //$NON-NLS-1$
if ((bootclasspathProperty == null) || (bootclasspathProperty.length() == 0)) {
// IBM J9 VMs
bootclasspathProperty = System.getProperty("vm.boot.class.path"); //$NON-NLS-1$
if ((bootclasspathProperty == null) || (bootclasspathProperty.length() == 0)) {
// Harmony using IBM VME
bootclasspathProperty = System.getProperty("org.apache.harmony.boot.class.path"); //$NON-NLS-1$
}
}
if ((bootclasspathProperty != null) && (bootclasspathProperty.length() != 0)) {
StringTokenizer tokenizer = new StringTokenizer(bootclasspathProperty, File.pathSeparator);
String token;
while (tokenizer.hasMoreTokens()) {
token = tokenizer.nextToken();
FileSystem.Classpath currentClasspath = FileSystem.getClasspath(token, null, null);
if (currentClasspath != null) {
bootclasspaths.add(currentClasspath);
}
}
} else {
// try to get all jars inside the lib folder of the java home
final File javaHome = getJavaHome();
if (javaHome != null) {
File[] directoriesToCheck = null;
if (System.getProperty("os.name").startsWith("Mac")) {//$NON-NLS-1$//$NON-NLS-2$
directoriesToCheck = new File[] {
new File(javaHome, "../Classes"), //$NON-NLS-1$
};
} else {
// fall back to try to retrieve them out of the lib directory
directoriesToCheck = new File[] {
new File(javaHome, "lib") //$NON-NLS-1$
};
}
File[][] systemLibrariesJars = Main.getLibrariesFiles(directoriesToCheck);
if (systemLibrariesJars != null) {
for (int i = 0, max = systemLibrariesJars.length; i < max; i++) {
File[] current = systemLibrariesJars[i];
if (current != null) {
for (int j = 0, max2 = current.length; j < max2; j++) {
FileSystem.Classpath classpath =
FileSystem.getClasspath(current[j].getAbsolutePath(),
null, false, null, null);
if (classpath != null) {
bootclasspaths.add(classpath);
}
}
}
}
}
}
}
}
示例6: collectRunningVMBootclasspath
import org.eclipse.jdt.internal.compiler.batch.FileSystem; //导入方法依赖的package包/类
public static void collectRunningVMBootclasspath(List bootclasspaths) {
/* no bootclasspath specified
* we can try to retrieve the default librairies of the VM used to run
* the batch compiler
*/
String javaversion = System.getProperty("java.version");//$NON-NLS-1$
if (javaversion != null && javaversion.equalsIgnoreCase("1.1.8")) { //$NON-NLS-1$
throw new IllegalStateException();
}
/*
* Handle >= JDK 1.2.2 settings: retrieve the bootclasspath
*/
// check bootclasspath properties for Sun, JRockit and Harmony VMs
String bootclasspathProperty = System.getProperty("sun.boot.class.path"); //$NON-NLS-1$
if ((bootclasspathProperty == null) || (bootclasspathProperty.length() == 0)) {
// IBM J9 VMs
bootclasspathProperty = System.getProperty("vm.boot.class.path"); //$NON-NLS-1$
if ((bootclasspathProperty == null) || (bootclasspathProperty.length() == 0)) {
// Harmony using IBM VME
bootclasspathProperty = System.getProperty("org.apache.harmony.boot.class.path"); //$NON-NLS-1$
}
}
if ((bootclasspathProperty != null) && (bootclasspathProperty.length() != 0)) {
StringTokenizer tokenizer = new StringTokenizer(bootclasspathProperty, File.pathSeparator);
String token;
while (tokenizer.hasMoreTokens()) {
token = tokenizer.nextToken();
FileSystem.Classpath currentClasspath = FileSystem.getClasspath(token, null, null);
if (currentClasspath != null) {
bootclasspaths.add(currentClasspath);
}
}
} else {
// try to get all jars inside the lib folder of the java home
final File javaHome = getJavaHome();
if (javaHome != null) {
File[] directoriesToCheck = null;
if (System.getProperty("os.name").startsWith("Mac")) {//$NON-NLS-1$//$NON-NLS-2$
directoriesToCheck = new File[]{
new File(javaHome, "../Classes"), //$NON-NLS-1$
};
} else {
// fall back to try to retrieve them out of the lib directory
directoriesToCheck = new File[]{
new File(javaHome, "lib") //$NON-NLS-1$
};
}
File[][] systemLibrariesJars = Main.getLibrariesFiles(directoriesToCheck);
if (systemLibrariesJars != null) {
for (int i = 0, max = systemLibrariesJars.length; i < max; i++) {
File[] current = systemLibrariesJars[i];
if (current != null) {
for (int j = 0, max2 = current.length; j < max2; j++) {
FileSystem.Classpath classpath =
FileSystem.getClasspath(current[j].getAbsolutePath(),
null, false, null, null);
if (classpath != null) {
bootclasspaths.add(classpath);
}
}
}
}
}
}
}
}