< prev index next >

src/java.xml/share/classes/javax/xml/datatype/SecuritySupport.java

Print this page




  62 
  63     FileInputStream getFileInputStream(final File file)
  64         throws FileNotFoundException
  65     {
  66         try {
  67             return (FileInputStream)
  68                 AccessController.doPrivileged(new PrivilegedExceptionAction() {
  69                     public Object run() throws FileNotFoundException {
  70                         return new FileInputStream(file);
  71                     }
  72                 });
  73         } catch (PrivilegedActionException e) {
  74             throw (FileNotFoundException)e.getException();
  75         }
  76     }
  77 
  78     boolean doesFileExist(final File f) {
  79     return ((Boolean)
  80             AccessController.doPrivileged(new PrivilegedAction() {
  81                 public Object run() {
  82                     return new Boolean(f.exists());
  83                 }
  84             })).booleanValue();
  85     }
  86 
  87 }


  62 
  63     FileInputStream getFileInputStream(final File file)
  64         throws FileNotFoundException
  65     {
  66         try {
  67             return (FileInputStream)
  68                 AccessController.doPrivileged(new PrivilegedExceptionAction() {
  69                     public Object run() throws FileNotFoundException {
  70                         return new FileInputStream(file);
  71                     }
  72                 });
  73         } catch (PrivilegedActionException e) {
  74             throw (FileNotFoundException)e.getException();
  75         }
  76     }
  77 
  78     boolean doesFileExist(final File f) {
  79     return ((Boolean)
  80             AccessController.doPrivileged(new PrivilegedAction() {
  81                 public Object run() {
  82                     return f.exists();
  83                 }
  84             })).booleanValue();
  85     }
  86 
  87 }
< prev index next >