Package wt.security
Class FileAccess
java.lang.Object
wt.security.Access
wt.security.FileAccess
public class FileAccess
extends wt.security.Access
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
Supported API: true
-
Method Summary
Modifier and TypeMethodDescriptionfinal booleanWrapper for File.canRead()
Supported API: truefinal booleanWrapper for File.canWrite()
Supported API: truefinal booleanWrapper for File.delete()
Supported API: truefinal booleanWrapper for File.exists()
Supported API: truefinal booleanfileEquals(File file1, File file2) Wrapper for File.equals()
Supported API: truefinal StringgetAbsolutePath(File file) Wrapper for File.getAbsolutePath()
Supported API: truefinal StringgetCanonicalPath(File file) Wrapper for File.getCanonicalPath()
Supported API: truestatic FileAccessGet instance ofFileAccess.static FileAccessgetFileAccess(Frame parentFrame) Get instance ofFileAccess.final FileInputStreamgetFileInputStream(File file) Wrapper for FileInputStream constructor.final FileInputStreamWrapper for FileInputStream constructor.final FileInputStreamgetFileInputStream(String file) Wrapper for FileInputStream constructor.final FileOutputStreamgetFileOutputStream(File file) Wrapper for FileOutputStream constructor.final FileOutputStreamWrapper for FileOutputStream constructor.final FileOutputStreamgetFileOutputStream(String file) Wrapper for FileOutputStream constructor.final FileOutputStreamgetFileOutputStream(String file, boolean append) Wrapper for FileOutputStream constructor.final StringWrapper for File.getParent()
Supported API: truefinal booleanisAbsolute(File file) Wrapper for File.isAbsolute()
Supported API: truefinal booleanisDirectory(File file) Wrapper for File.isDirectory()
Supported API: truefinal booleanWrapper for File.isFile()
Supported API: trueprotected final voidJFileChooser_setCurrentDirectory(wt.security.WTJFileChooser jfc, File dir) Wrapper for JFileChooser.setCurrentDirectory().final voidJFileChooser_setSelectedFile(wt.security.WTJFileChooser jfc, File file) Wrapper for JFileChooser.setSelectedFile().final voidJFileChooser_setSelectedFiles(wt.security.WTJFileChooser jfc, File[] files) Wrapper for JFileChooser.setSelectedFiles().protected final intJFileChooser_showDialog(wt.security.WTJFileChooser jfc, Component parent, String text) Wrapper for JFileChooser.showDialog().final longlastModified(File file) Wrapper for File.lastModified()
Supported API: truefinal longWrapper for File.length()
Supported API: truefinal String[]Wrapper for File.list()
Supported API: truefinal File[]Wrapper for File.listFiles()
Supported API: truefinal booleanWrapper for File.mkdir()
Supported API: truefinal booleanWrapper for File.mkdirs()
Supported API: truefinal FileDialognewFileDialog(Frame frame) Wrapper for new FileDialog().final JFileChooserWrapper for new JFileChooser().final JFileChoosernewJFileChooser(File currentDirectory) Wrapper for new JFileChooser(File).final booleanWrapper for File.renameTo()
Supported API: true
-
Method Details
-
getFileAccess
Get instance ofFileAccess. This instance can then be used to perform file operation that are typically restricted by the sandbox.
Supported API: true- Parameters:
parentFrame- the parent frame for security dialog boxes that may be presented
-
getFileAccess
Get instance ofFileAccess. This instance can then be used to perform file operation that are typically restricted by the sandbox.
Supported API: true -
getFileInputStream
public final FileInputStream getFileInputStream(String file) throws WTSecurityException, FileNotFoundException Wrapper for FileInputStream constructor.
Supported API: true- Parameters:
file- the filename for the file to be opened for the input stream- Throws:
WTSecurityExceptionFileNotFoundException
-
getFileInputStream
public final FileInputStream getFileInputStream(File file) throws WTSecurityException, FileNotFoundException Wrapper for FileInputStream constructor.
Supported API: true- Parameters:
file- the file to be opened for the input stream- Throws:
WTSecurityExceptionFileNotFoundException
-
getFileInputStream
Wrapper for FileInputStream constructor.
Supported API: true- Parameters:
file- the file descriptor of the file to be opened for the input stream- Throws:
WTSecurityException
-
getFileOutputStream
public final FileOutputStream getFileOutputStream(File file) throws WTSecurityException, IOException Wrapper for FileOutputStream constructor.
Supported API: true- Parameters:
file- the file to be opened for the output stream- Throws:
WTSecurityExceptionIOException
-
getFileOutputStream
Wrapper for FileOutputStream constructor.
Supported API: true- Parameters:
file- the file descriptor to the file to be opened for the output stream- Throws:
WTSecurityException
-
getFileOutputStream
public final FileOutputStream getFileOutputStream(String file) throws WTSecurityException, IOException Wrapper for FileOutputStream constructor.
Supported API: true- Parameters:
file- the filename to the file to be opened for the output stream- Throws:
WTSecurityExceptionIOException
-
getFileOutputStream
public final FileOutputStream getFileOutputStream(String file, boolean append) throws WTSecurityException, IOException Wrapper for FileOutputStream constructor.
Supported API: true- Parameters:
file- the filename to the file to be opened for the output streamappend- boolean stating if the file should be appended to- Throws:
WTSecurityExceptionIOException
-
exists
Wrapper for File.exists()
Supported API: true- Parameters:
file- the file the operation is being performed upon- Throws:
WTSecurityException
-
list
Wrapper for File.list()
Supported API: true- Parameters:
file- the file the operation is being performed upon- Throws:
WTSecurityException
-
listFiles
Wrapper for File.listFiles()
Supported API: true- Parameters:
file- the file the operation is being performed upon- Throws:
WTSecurityException
-
isFile
Wrapper for File.isFile()
Supported API: true- Parameters:
file- the file the operation is being performed upon- Throws:
WTSecurityException
-
isDirectory
Wrapper for File.isDirectory()
Supported API: true- Parameters:
file- the file the operation is being performed upon- Throws:
WTSecurityException
-
isAbsolute
Wrapper for File.isAbsolute()
Supported API: true- Parameters:
file- the file the operation is being performed upon- Throws:
WTSecurityException
-
lastModified
Wrapper for File.lastModified()
Supported API: true- Parameters:
file- the file the operation is being performed upon- Throws:
WTSecurityException
-
length
Wrapper for File.length()
Supported API: true- Parameters:
file- the file the operation is being performed upon- Throws:
WTSecurityException
-
mkdir
Wrapper for File.mkdir()
Supported API: true- Parameters:
file- the file the operation is being performed upon- Throws:
WTSecurityException
-
mkdirs
Wrapper for File.mkdirs()
Supported API: true- Parameters:
file- the file the operation is being performed upon- Throws:
WTSecurityException
-
renameTo
Wrapper for File.renameTo()
Supported API: true- Parameters:
from- the file that is being renamedto- the file that from is being renamed to- Throws:
WTSecurityException
-
delete
Wrapper for File.delete()
Supported API: true- Parameters:
file- the file the operation is being performed upon- Throws:
WTSecurityException
-
getCanonicalPath
Wrapper for File.getCanonicalPath()
Supported API: true- Parameters:
file- the file the operation is being performed upon- Throws:
WTSecurityExceptionIOException
-
getParent
Wrapper for File.getParent()
Supported API: true- Parameters:
file- the file the operation is being performed upon- Throws:
WTSecurityException
-
getAbsolutePath
Wrapper for File.getAbsolutePath()
Supported API: true- Parameters:
file- the file the operation is being performed upon- Throws:
WTSecurityExceptionIOException
-
canRead
Wrapper for File.canRead()
Supported API: true- Parameters:
file- the file the operation is being performed upon- Throws:
WTSecurityException
-
canWrite
Wrapper for File.canWrite()
Supported API: true- Parameters:
file- the file the operation is being performed upon- Throws:
WTSecurityException
-
fileEquals
Wrapper for File.equals()
Supported API: true- Throws:
WTSecurityException
-
newFileDialog
Wrapper for new FileDialog(). This operation requires permission under Internet Explorer.
Supported API: true- Parameters:
frame- the parent frame for this newly constructed FileDialog- Throws:
WTSecurityException
-
newJFileChooser
Wrapper for new JFileChooser().
Supported API: true- Throws:
WTSecurityException
-
newJFileChooser
Wrapper for new JFileChooser(File).
Supported API: true- Throws:
WTSecurityException
-
JFileChooser_showDialog
protected final int JFileChooser_showDialog(wt.security.WTJFileChooser jfc, Component parent, String text) throws WTSecurityException Wrapper for JFileChooser.showDialog().
Supported API: true- Parameters:
parent- the parent component of the dialogtext- the text of theApproveButton- Throws:
WTSecurityException
-
JFileChooser_setCurrentDirectory
protected final void JFileChooser_setCurrentDirectory(wt.security.WTJFileChooser jfc, File dir) throws WTSecurityException Wrapper for JFileChooser.setCurrentDirectory().
Supported API: true- Parameters:
dir- the current directory to point to- Throws:
WTSecurityException
-
JFileChooser_setSelectedFile
public final void JFileChooser_setSelectedFile(wt.security.WTJFileChooser jfc, File file) throws WTSecurityException Wrapper for JFileChooser.setSelectedFile().
Supported API: true- Parameters:
file- the file currently selected- Throws:
WTSecurityException
-
JFileChooser_setSelectedFiles
public final void JFileChooser_setSelectedFiles(wt.security.WTJFileChooser jfc, File[] files) throws WTSecurityException Wrapper for JFileChooser.setSelectedFiles().
Supported API: true- Parameters:
file- the file currently selected- Throws:
WTSecurityException
-