Name
FilePermission
Synopsis
This class is
a java.security.Permission that governs access to
the local filesystem. A FilePermission has a name,
or target, which specifies what file or files it pertains to, and a
commaseparated list of actions that may be performed on the file or
files. The supported actions are
read,
write, delete, and execute. Read and write permission are required by
any methods that read or write a file. Delete permission is required
by File.delete( ), and execute permission is
required by Runtime.exec( ).
The
name
of a FilePermission may be as simple as a file or
directory name. FilePermission also supports the
use of certain wildcards, however, to specify a
permission that applies to more than one file. If the name of the
FilePermission is a directory name followed by
/* (\* on
Windows platforms), it
specifies all files in the named directory. If the name is a
directory name followed by /-
(\- on Windows), it specifies all files in the
directory, and, recursively, all files in all subdirectories. A
* alone specifies all files in the current
directory, and a - alone specifies all files in or
beneath the current directory. Finally, the special name <<ALL
FILES>> matches all files anywhere in the filesystem.
Applications
do not need to use
this class directly. Programmers writing system-level code and system
administrators configuring security policies may need to use it,
however. Be very careful when granting any type of
FilePermission. Restricting access ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access