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