Package com.logicaldoc.util.exec
Class PrivilegedRunner
- java.lang.Object
-
- com.logicaldoc.util.exec.PrivilegedRunner
-
public class PrivilegedRunner extends Object
This class is responsible for allowing the java program to launch a command with administrator permissions. The way of achieving this greatly varies among the platforms. The JDK classes are of not help here as there is no way to tell a JVM to run as a different user but to launch a new one.
-
-
Constructor Summary
Constructors Constructor Description PrivilegedRunner()
Builds a default privileged runner.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
executeWithElevatedRights(String command)
static boolean
isMac()
static boolean
isUnix()
static boolean
isWindows()
-
-
-
Method Detail
-
executeWithElevatedRights
public int executeWithElevatedRights(String command) throws IOException, InterruptedException
- Throws:
IOException
InterruptedException
-
isWindows
public static boolean isWindows()
-
isMac
public static boolean isMac()
-
isUnix
public static boolean isUnix()
-
-