Java FilePermission.getActions()
Syntax
FilePermission.getActions() has the following syntax.
public String getActions()
Example
In the following code shows how to use FilePermission.getActions() method.
// w w w . ja v a 2s .c o m
import java.io.FilePermission;
import java.io.IOException;
public class Main {
public static void main(String[] args) throws IOException {
FilePermission fp = new FilePermission("C://test.txt", "read");
// the canonical string representation of the action
String s = fp.getActions();
System.out.print("Action: " + s);
}
}
The code above generates the following result.
Home »
Java Tutorial »
java.io »
Java Tutorial »
java.io »