// no user classpath specified.
classpaths = new ArrayList(DEFAULT_SIZE_CLASSPATH);
String classProp = System.getProperty("java.class.path"); //$NON-NLS-1$
if ((classProp == null) || (classProp.length() == 0)) {
addPendingErrors(this.bind("configure.noClasspath")); //$NON-NLS-1$
final Classpath classpath = FileSystem.getClasspath(System.getProperty("user.dir"), customEncoding, null);//$NON-NLS-1$
if (classpath != null) {
classpaths.add(classpath);
}
} else {
StringTokenizer tokenizer = new StringTokenizer(classProp, File.pathSeparator);
String token;
while (tokenizer.hasMoreTokens()) {
token = tokenizer.nextToken();
FileSystem.Classpath currentClasspath = FileSystem
.getClasspath(token, customEncoding, null);
if (currentClasspath != null) {
classpaths.add(currentClasspath);
} else if (token.length() != 0) {
addPendingErrors(this.bind("configure.incorrectClasspath", token));//$NON-NLS-1$
}
}
}
}
ArrayList result = new ArrayList();
HashMap knownNames = new HashMap();
FileSystem.ClasspathSectionProblemReporter problemReporter =
new FileSystem.ClasspathSectionProblemReporter() {
public void invalidClasspathSection(String jarFilePath) {
addPendingErrors(bind("configure.invalidClasspathSection", jarFilePath)); //$NON-NLS-1$
}
public void multipleClasspathSections(String jarFilePath) {
addPendingErrors(bind("configure.multipleClasspathSections", jarFilePath)); //$NON-NLS-1$
}
};
while (! classpaths.isEmpty()) {
Classpath current = (Classpath) classpaths.remove(0);
String currentPath = current.getPath();
if (knownNames.get(currentPath) == null) {
knownNames.put(currentPath, current);
result.add(current);
List linkedJars = current.fetchLinkedJars(problemReporter);
if (linkedJars != null) {
classpaths.addAll(0, linkedJars);
}
}
}