Lines 1276-1281
Link Here
|
1276 |
} |
1276 |
} |
1277 |
} |
1277 |
} |
1278 |
|
1278 |
|
|
|
1279 |
//On VMS, the case of the JRE classpaths returned from System.property |
1280 |
//isn't necessary consistent with the case of the JRE files on the physical |
1281 |
//disk. So we look up the directory and fix the case of the classpaths. |
1282 |
public static String normalizeVMSFilePaths(String paths) { |
1283 |
String[] pathTokens = paths.split(File.pathSeparator); |
1284 |
StringBuffer newPaths = new StringBuffer(); |
1285 |
for(int i=0; i<pathTokens.length; i++) { |
1286 |
if (pathTokens[i].length() > 0) |
1287 |
newPaths.append( |
1288 |
normalizeVMSFilePath(pathTokens[i]) |
1289 |
+ ((i+1) < pathTokens.length ? File.pathSeparator : "")); |
1290 |
} |
1291 |
return newPaths.toString(); |
1292 |
} |
1293 |
|
1294 |
//On VMS, the case of the JRE classpaths returned from System.property |
1295 |
//isn't necessary consistent with the case of the JRE files on the physical |
1296 |
//disk. So we look up the directory and fix the case of the classpaths. |
1297 |
public static String normalizeVMSFilePath(String path) { |
1298 |
//First, take out the 000000 |
1299 |
String nPath = path.replaceAll("/000000",""); |
1300 |
|
1301 |
//Now fix the cases of each files and directories |
1302 |
//by comparing against the native filesystem |
1303 |
StringBuffer newPath = new StringBuffer(); |
1304 |
String[] stok = nPath.split("/"); |
1305 |
|
1306 |
//Do the File.list of each directory from the root |
1307 |
//to find the correct case of each sub files/directories and construct |
1308 |
//a new path |
1309 |
for(int i=0; i<stok.length; i++) { |
1310 |
if(stok[i].length() == 0) |
1311 |
continue; |
1312 |
newPath.append(File.separatorChar + stok[i]); |
1313 |
File f = new File(newPath.toString()); |
1314 |
if (f.isDirectory()) { |
1315 |
String [] files = f.list(); |
1316 |
for (int j=0; j<files.length; j++) { |
1317 |
if ((i+1) < stok.length && files[j].equalsIgnoreCase(stok[i+1])) { |
1318 |
stok[i+1] = files[j]; |
1319 |
break; |
1320 |
} |
1321 |
} |
1322 |
} |
1323 |
} |
1324 |
return newPath.toString(); |
1325 |
} |
1326 |
|
1279 |
private static final class NonCanonicalizingFileSystemView extends FileSystemView { |
1327 |
private static final class NonCanonicalizingFileSystemView extends FileSystemView { |
1280 |
private final FileSystemView delegate = FileSystemView.getFileSystemView(); |
1328 |
private final FileSystemView delegate = FileSystemView.getFileSystemView(); |
1281 |
public NonCanonicalizingFileSystemView() {} |
1329 |
public NonCanonicalizingFileSystemView() {} |