|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cbr.service.PrivilegedOpen
This class opens either a FileInputStream or a FileOutputStream to the file that is passed in the constructor, depending on the mode also passed to the constructor.
Field Summary | |
private boolean |
create_
If true then the parent directory
is created if it does not already exist. |
private File |
file_
The file from which the image is read. |
private boolean |
mode_
The mode, either read or write |
static boolean |
READ
|
static boolean |
WRITE
|
Constructor Summary | |
PrivilegedOpen(File file,
boolean mode)
Creates an instance that opens the given file for the given mode. |
|
PrivilegedOpen(File file,
boolean mode,
boolean create)
Creates an instance that opens the given file for the given mode. |
Method Summary | |
Object |
run()
Depending on the mode that was passed to the constructor this method returns either a FileInputStream or a FileOutputStream to the file passed to the constructor. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final boolean READ
public static final boolean WRITE
private File file_
private boolean mode_
private boolean create_
true
then the parent directory
is created if it does not already exist.
Constructor Detail |
public PrivilegedOpen(File file, boolean mode)
file
- The file to open.mode
- The mode, either READ
or
WRITE
.
NullPointerException
- if no file is given.public PrivilegedOpen(File file, boolean mode, boolean create)
create
is true
then the parent directory is created if it
does not already exist.
file
- The file to open.mode
- The mode, either READ
or
WRITE
.create
- true
if the parent directory
shall be created if it does not already exist.
NullPointerException
- if no file is given.Method Detail |
public Object run()
null
is returned.
run
in interface PrivilegedAction
null
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |