< prev index next >

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

Print this page




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


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