|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectwt.security.Access
wt.security.FileAccess
public class FileAccess
Class that provides wrappers to priviledged file methods using
the wt.security package. This allows applets to perform file
operations that are typically restricted by the sandbox.
Supported API: true
| Method Summary | |
|---|---|
boolean |
canRead(File file)
Wrapper for File.canRead() |
boolean |
canWrite(File file)
Wrapper for File.canWrite() |
boolean |
delete(File file)
Wrapper for File.delete() |
boolean |
exists(File file)
Wrapper for File.exists() |
boolean |
fileEquals(File file0,
File file1)
Wrapper for File.equals() |
String |
getAbsolutePath(File file)
Wrapper for File.getAbsolutePath() |
String |
getCanonicalPath(File file)
Wrapper for File.getCanonicalPath() |
static FileAccess |
getFileAccess()
Get instance of FileAccess. |
static FileAccess |
getFileAccess(Frame parentFrame)
Get instance of FileAccess. |
FileInputStream |
getFileInputStream(File file)
Wrapper for FileInputStream constructor. |
FileInputStream |
getFileInputStream(FileDescriptor file)
Wrapper for FileInputStream constructor. |
FileInputStream |
getFileInputStream(String file)
Wrapper for FileInputStream constructor. |
FileOutputStream |
getFileOutputStream(File file)
Wrapper for FileOutputStream constructor. |
FileOutputStream |
getFileOutputStream(FileDescriptor file)
Wrapper for FileOutputStream constructor. |
FileOutputStream |
getFileOutputStream(String file)
Wrapper for FileOutputStream constructor. |
FileOutputStream |
getFileOutputStream(String file,
boolean append)
Wrapper for FileOutputStream constructor. |
String |
getParent(File file)
Wrapper for File.getParent() |
boolean |
isAbsolute(File file)
Wrapper for File.isAbsolute() |
boolean |
isDirectory(File file)
Wrapper for File.isDirectory() |
boolean |
isFile(File file)
Wrapper for File.isFile() |
protected void |
JFileChooser_setCurrentDirectory(wt.security.WTJFileChooser jfc,
File dir)
Wrapper for JFileChooser.setCurrentDirectory(). |
void |
JFileChooser_setSelectedFile(wt.security.WTJFileChooser jfc,
File file)
Wrapper for JFileChooser.setSelectedFile(). |
void |
JFileChooser_setSelectedFiles(wt.security.WTJFileChooser jfc,
File[] files)
Wrapper for JFileChooser.setSelectedFiles(). |
protected int |
JFileChooser_showDialog(wt.security.WTJFileChooser jfc,
Component parent,
String text)
Wrapper for JFileChooser.showDialog(). |
long |
lastModified(File file)
Wrapper for File.lastModified() |
long |
length(File file)
Wrapper for File.length() |
String[] |
list(File file)
Wrapper for File.list() |
File[] |
listFiles(File file)
Wrapper for File.listFiles() |
boolean |
mkdir(File file)
Wrapper for File.mkdir() |
boolean |
mkdirs(File file)
Wrapper for File.mkdirs() |
FileDialog |
newFileDialog(Frame frame)
Wrapper for new FileDialog(). |
JFileChooser |
newJFileChooser()
Wrapper for new JFileChooser(). |
JFileChooser |
newJFileChooser(File currentDirectory)
Wrapper for new JFileChooser(File). |
boolean |
renameTo(File from,
File to)
Wrapper for File.renameTo() |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static FileAccess getFileAccess(Frame parentFrame)
FileAccess. This instance can then be used
to perform file operation that are typically restricted by the sandbox.
parentFrame - the parent frame for security dialog boxes that may be
presented
public static FileAccess getFileAccess()
FileAccess. This instance can then be used
to perform file operation that are typically restricted by the sandbox.
public final FileInputStream getFileInputStream(String file)
throws WTSecurityException,
FileNotFoundException
file - the filename for the file to be opened for the input stream
WTSecurityException
FileNotFoundException
public final FileInputStream getFileInputStream(File file)
throws WTSecurityException,
FileNotFoundException
file - the file to be opened for the input stream
WTSecurityException
FileNotFoundException
public final FileInputStream getFileInputStream(FileDescriptor file)
throws WTSecurityException
file - the file descriptor of the file to be opened for the input stream
WTSecurityException
public final FileOutputStream getFileOutputStream(File file)
throws WTSecurityException,
IOException
file - the file to be opened for the output stream
WTSecurityException
IOException
public final FileOutputStream getFileOutputStream(FileDescriptor file)
throws WTSecurityException
file - the file descriptor to the file to be opened for the output stream
WTSecurityException
public final FileOutputStream getFileOutputStream(String file)
throws WTSecurityException,
IOException
file - the filename to the file to be opened for the output stream
WTSecurityException
IOException
public final FileOutputStream getFileOutputStream(String file,
boolean append)
throws WTSecurityException,
IOException
file - the filename to the file to be opened for the output streamappend - boolean stating if the file should be appended to
WTSecurityException
IOException
public final boolean exists(File file)
throws WTSecurityException
file - the file the operation is being performed upon
WTSecurityException
public final String[] list(File file)
throws WTSecurityException
file - the file the operation is being performed upon
WTSecurityException
public final File[] listFiles(File file)
throws WTSecurityException
file - the file the operation is being performed upon
WTSecurityException
public final boolean isFile(File file)
throws WTSecurityException
file - the file the operation is being performed upon
WTSecurityException
public final boolean isDirectory(File file)
throws WTSecurityException
file - the file the operation is being performed upon
WTSecurityException
public final boolean isAbsolute(File file)
throws WTSecurityException
file - the file the operation is being performed upon
WTSecurityException
public final long lastModified(File file)
throws WTSecurityException
file - the file the operation is being performed upon
WTSecurityException
public final long length(File file)
throws WTSecurityException
file - the file the operation is being performed upon
WTSecurityException
public final boolean mkdir(File file)
throws WTSecurityException
file - the file the operation is being performed upon
WTSecurityException
public final boolean mkdirs(File file)
throws WTSecurityException
file - the file the operation is being performed upon
WTSecurityException
public final boolean renameTo(File from,
File to)
throws WTSecurityException
from - the file that is being renamedto - the file that from is being renamed to
WTSecurityException
public final boolean delete(File file)
throws WTSecurityException
file - the file the operation is being performed upon
WTSecurityException
public final String getCanonicalPath(File file)
throws WTSecurityException,
IOException
file - the file the operation is being performed upon
WTSecurityException
IOException
public final String getParent(File file)
throws WTSecurityException
file - the file the operation is being performed upon
WTSecurityException
public final String getAbsolutePath(File file)
throws WTSecurityException,
IOException
file - the file the operation is being performed upon
WTSecurityException
IOException
public final boolean canRead(File file)
throws WTSecurityException
file - the file the operation is being performed upon
WTSecurityException
public final boolean canWrite(File file)
throws WTSecurityException
file - the file the operation is being performed upon
WTSecurityException
public final boolean fileEquals(File file0,
File file1)
throws WTSecurityException
file - the file the operation is being performed upon
WTSecurityException
public final FileDialog newFileDialog(Frame frame)
throws WTSecurityException
frame - the parent frame for this newly constructed FileDialog
WTSecurityException
public final JFileChooser newJFileChooser()
throws WTSecurityException
WTSecurityException
public final JFileChooser newJFileChooser(File currentDirectory)
throws WTSecurityException
WTSecurityException
protected final int JFileChooser_showDialog(wt.security.WTJFileChooser jfc,
Component parent,
String text)
throws WTSecurityException
parent - the parent component of the dialogtext - the text of the ApproveButton
WTSecurityException
protected final void JFileChooser_setCurrentDirectory(wt.security.WTJFileChooser jfc,
File dir)
throws WTSecurityException
dir - the current directory to point to
WTSecurityException
public final void JFileChooser_setSelectedFile(wt.security.WTJFileChooser jfc,
File file)
throws WTSecurityException
file - the file currently selected
WTSecurityException
public final void JFileChooser_setSelectedFiles(wt.security.WTJFileChooser jfc,
File[] files)
throws WTSecurityException
file - the file currently selected
WTSecurityException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||