Java IO Tutorial - 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.

/*from  w w  w  .j  a va  2  s . 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.