Lines 12-18
Link Here
|
12 |
|
12 |
|
13 |
import java.io.File; |
13 |
import java.io.File; |
14 |
import java.io.IOException; |
14 |
import java.io.IOException; |
15 |
import java.util.zip.ZipFile; |
|
|
16 |
|
15 |
|
17 |
import org.eclipse.jdt.core.compiler.CharOperation; |
16 |
import org.eclipse.jdt.core.compiler.CharOperation; |
18 |
import org.eclipse.jdt.internal.compiler.env.AccessRuleSet; |
17 |
import org.eclipse.jdt.internal.compiler.env.AccessRuleSet; |
Lines 77-101
Link Here
|
77 |
static Classpath getClasspath(String classpathName, String encoding, |
76 |
static Classpath getClasspath(String classpathName, String encoding, |
78 |
int classpathDirectoryMode, AccessRuleSet accessRuleSet) { |
77 |
int classpathDirectoryMode, AccessRuleSet accessRuleSet) { |
79 |
Classpath result = null; |
78 |
Classpath result = null; |
80 |
try { |
79 |
File file = new File(convertPathSeparators(classpathName)); |
81 |
File file = new File(convertPathSeparators(classpathName)); |
80 |
if (file.isDirectory()) { |
82 |
if (file.isDirectory()) { |
81 |
if (file.exists()) { |
83 |
if (file.exists()) { |
82 |
result = new ClasspathDirectory(file, encoding, |
84 |
result = new ClasspathDirectory(file, encoding, |
83 |
classpathDirectoryMode, accessRuleSet); |
85 |
classpathDirectoryMode, accessRuleSet); |
84 |
} |
86 |
} |
85 |
} else { |
87 |
} else { |
86 |
String lowercaseClasspathName = classpathName.toLowerCase(); |
88 |
String lowercaseClasspathName = classpathName.toLowerCase(); |
87 |
if (lowercaseClasspathName.endsWith(SUFFIX_STRING_jar) |
89 |
if (lowercaseClasspathName.endsWith(SUFFIX_STRING_jar) |
88 |
|| lowercaseClasspathName.endsWith(SUFFIX_STRING_zip)) { |
90 |
|| lowercaseClasspathName.endsWith(SUFFIX_STRING_zip)) { |
89 |
result = new ClasspathJar(file, true, |
91 |
result = new ClasspathJar(new ZipFile(file), true, |
90 |
accessRuleSet); |
92 |
accessRuleSet); |
91 |
// will throw an IOException if file does not exist |
93 |
// will throw an IOException if file does not exist |
|
|
94 |
} |
95 |
} |
96 |
} catch (IOException e) { |
97 |
// result = null; -- this is already the case |
98 |
} |
92 |
} |
|
|
93 |
} |
99 |
return result; |
94 |
return result; |
100 |
} |
95 |
} |
101 |
private void initializeKnownFileNames(String[] initialFileNames) { |
96 |
private void initializeKnownFileNames(String[] initialFileNames) { |
Lines 174-180
Link Here
|
174 |
return null; |
169 |
return null; |
175 |
} |
170 |
} |
176 |
public ClasspathJar getClasspathJar(File file) throws IOException { |
171 |
public ClasspathJar getClasspathJar(File file) throws IOException { |
177 |
return new ClasspathJar(new ZipFile(file), true, null); |
172 |
return new ClasspathJar(file, true, null); |
178 |
} |
173 |
} |
179 |
public boolean isPackage(char[][] compoundName, char[] packageName) { |
174 |
public boolean isPackage(char[][] compoundName, char[] packageName) { |
180 |
String qualifiedPackageName = new String(CharOperation.concatWith(compoundName, packageName, '/')); |
175 |
String qualifiedPackageName = new String(CharOperation.concatWith(compoundName, packageName, '/')); |