Files
2019-05-22 19:31:49 +08:00

26 lines
507 B
Java

package jaas;
import java.security.*;
/**
* This action looks up a system property.
*/
public class SysPropAction implements PrivilegedAction<String>
{
private String propertyName;
/**
* Constructs an action for looking up a given property.
* @param propertyName the property name (such as "user.home")
*/
public SysPropAction(String propertyName)
{
this.propertyName = propertyName;
}
public String run()
{
return System.getProperty(propertyName);
}
}