--- a/jaxp/src/com/sun/org/apache/bcel/internal/util/ClassPath.java Wed Jul 05 18:46:58 2017 +0200
+++ b/jaxp/src/com/sun/org/apache/bcel/internal/util/ClassPath.java Mon Feb 18 11:33:35 2013 -0800
@@ -66,6 +66,7 @@
* Responsible for loading (class) files from the CLASSPATH. Inspired by
* sun.tools.ClassPath.
*
+ * @version $Id: ClassPath.java,v 1.4 2007-07-19 04:34:52 ofung Exp $
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
*/
public class ClassPath implements Serializable {
@@ -83,7 +84,7 @@
ArrayList vec = new ArrayList();
for(StringTokenizer tok=new StringTokenizer(class_path,
- System.getProperty("path.separator"));
+ SecuritySupport.getSystemProperty("path.separator"));
tok.hasMoreTokens();)
{
String path = tok.nextToken();
@@ -92,7 +93,7 @@
File file = new File(path);
try {
- if(file.exists()) {
+ if(SecuritySupport.getFileExists(file)) {
if(file.isDirectory())
vec.add(new Dir(path));
else
@@ -143,8 +144,9 @@
String name = tok.nextToken();
File file = new File(name);
- if(file.exists())
+ if(SecuritySupport.getFileExists(file)) {
list.add(name);
+ }
}
}
}
@@ -159,9 +161,9 @@
String class_path, boot_path, ext_path;
try {
- class_path = System.getProperty("java.class.path");
- boot_path = System.getProperty("sun.boot.class.path");
- ext_path = System.getProperty("java.ext.dirs");
+ class_path = SecuritySupport.getSystemProperty("java.class.path");
+ boot_path = SecuritySupport.getSystemProperty("sun.boot.class.path");
+ ext_path = SecuritySupport.getSystemProperty("java.ext.dirs");
}
catch (SecurityException e) {
return "";
@@ -176,8 +178,8 @@
getPathComponents(ext_path, dirs);
for(Iterator e = dirs.iterator(); e.hasNext(); ) {
- File ext_dir = new File((String)e.next());
- String[] extensions = ext_dir.list(new FilenameFilter() {
+ File ext_dir = new File((String)e.next());
+ String[] extensions = SecuritySupport.getFileList(ext_dir, new FilenameFilter() {
public boolean accept(File dir, String name) {
name = name.toLowerCase();
return name.endsWith(".zip") || name.endsWith(".jar");
@@ -342,7 +344,7 @@
final File file = new File(dir + File.separatorChar +
name.replace('.', File.separatorChar) + suffix);
- return file.exists()? new ClassFile() {
+ return SecuritySupport.getFileExists(file)? new ClassFile() {
public InputStream getInputStream() throws IOException { return new FileInputStream(file); }
public String getPath() { try {