Lines 56-73
Link Here
|
56 |
classPathNames is a collection is Strings representing the full path of each class path |
56 |
classPathNames is a collection is Strings representing the full path of each class path |
57 |
initialFileNames is a collection is Strings, the trailing '.java' will be removed if its not already. |
57 |
initialFileNames is a collection is Strings, the trailing '.java' will be removed if its not already. |
58 |
*/ |
58 |
*/ |
59 |
|
|
|
60 |
public FileSystem(String[] classpathNames, String[] initialFileNames, String encoding) { |
59 |
public FileSystem(String[] classpathNames, String[] initialFileNames, String encoding) { |
61 |
this(classpathNames, initialFileNames, encoding, null); |
|
|
62 |
} |
63 |
public FileSystem(String[] classpathNames, String[] initialFileNames, String encoding, int[] classpathDirectoryModes) { |
64 |
final int classpathSize = classpathNames.length; |
60 |
final int classpathSize = classpathNames.length; |
65 |
this.classpaths = new Classpath[classpathSize]; |
61 |
this.classpaths = new Classpath[classpathSize]; |
66 |
int counter = 0; |
62 |
int counter = 0; |
67 |
for (int i = 0; i < classpathSize; i++) { |
63 |
for (int i = 0; i < classpathSize; i++) { |
68 |
Classpath classpath = getClasspath(classpathNames[i], encoding, |
64 |
Classpath classpath = getClasspath(classpathNames[i], encoding, null); |
69 |
classpathDirectoryModes == null ? 0 |
|
|
70 |
: classpathDirectoryModes[i], null); |
71 |
try { |
65 |
try { |
72 |
classpath.initialize(); |
66 |
classpath.initialize(); |
73 |
this.classpaths[counter++] = classpath; |
67 |
this.classpaths[counter++] = classpath; |
Lines 99-118
Link Here
|
99 |
} |
93 |
} |
100 |
initializeKnownFileNames(initialFileNames); |
94 |
initializeKnownFileNames(initialFileNames); |
101 |
} |
95 |
} |
102 |
static Classpath getClasspath(String classpathName, String encoding, |
96 |
static Classpath getClasspath(String classpathName, String encoding, AccessRuleSet accessRuleSet) { |
103 |
int classpathDirectoryMode, AccessRuleSet accessRuleSet) { |
97 |
return getClasspath(classpathName, encoding, ClasspathLocation.SOURCE | ClasspathLocation.BINARY, accessRuleSet); |
|
|
98 |
} |
99 |
static Classpath getClasspath(String classpathName, String encoding, int mode, AccessRuleSet accessRuleSet) { |
104 |
Classpath result = null; |
100 |
Classpath result = null; |
105 |
File file = new File(convertPathSeparators(classpathName)); |
101 |
File file = new File(convertPathSeparators(classpathName)); |
106 |
if (file.isDirectory()) { |
102 |
if (file.isDirectory()) { |
107 |
if (file.exists()) { |
103 |
if (file.exists()) { |
108 |
result = new ClasspathDirectory(file, encoding, |
104 |
result = new ClasspathDirectory(file, encoding, mode, accessRuleSet); |
109 |
classpathDirectoryMode, accessRuleSet); |
|
|
110 |
} |
105 |
} |
111 |
} else { |
106 |
} else { |
112 |
String lowercaseClasspathName = classpathName.toLowerCase(); |
107 |
String lowercaseClasspathName = classpathName.toLowerCase(); |
113 |
if (lowercaseClasspathName.endsWith(SUFFIX_STRING_jar) |
108 |
if (lowercaseClasspathName.endsWith(SUFFIX_STRING_jar) |
114 |
|| lowercaseClasspathName.endsWith(SUFFIX_STRING_zip)) { |
109 |
|| lowercaseClasspathName.endsWith(SUFFIX_STRING_zip)) { |
115 |
result = new ClasspathJar(file, true, accessRuleSet); |
110 |
result = new ClasspathJar(file, true, accessRuleSet, mode, encoding); |
116 |
// will throw an IOException if file does not exist |
111 |
// will throw an IOException if file does not exist |
117 |
} |
112 |
} |
118 |
} |
113 |
} |
Lines 211-219
Link Here
|
211 |
typeName); |
206 |
typeName); |
212 |
return null; |
207 |
return null; |
213 |
} |
208 |
} |
214 |
public ClasspathJar getClasspathJar(File file) throws IOException { |
|
|
215 |
return new ClasspathJar(file, true, null); |
216 |
} |
217 |
public boolean isPackage(char[][] compoundName, char[] packageName) { |
209 |
public boolean isPackage(char[][] compoundName, char[] packageName) { |
218 |
String qualifiedPackageName = new String(CharOperation.concatWith(compoundName, packageName, '/')); |
210 |
String qualifiedPackageName = new String(CharOperation.concatWith(compoundName, packageName, '/')); |
219 |
String qp2 = File.separatorChar == '/' ? qualifiedPackageName : qualifiedPackageName.replace('/', File.separatorChar); |
211 |
String qp2 = File.separatorChar == '/' ? qualifiedPackageName : qualifiedPackageName.replace('/', File.separatorChar); |