/** * Find the Native Process Id of the given java.lang.process * * @param process (java.lang.process) * @return pid, the Native Process ID */ public int getWindowsProcessId(Process process) throws NativeAccessException { ensureWindowsSupport(NativeFunction.WINDOWS_PROCESS); return nativeWindowsSupport.getWindowsProcessId(process); }
/** * Check if .NET is installed on a the Windows machine * * @return true if .NET is installed. * @throws hudson.util.jna.Native.ExecutionError */ public boolean isDotNetInstalled(int major, int minor) throws NativeAccessException { ensureWindowsSupport(NativeFunction.DOTNET); return nativeWindowsSupport.isDotNetInstalled(major, minor); }
/** * Get all the native processes on a Windows System * * @return List of Native Window Processes * @throws hudson.util.jna.Native.ExecutionError */ public List<NativeProcess> getWindowsProcesses() throws NativeAccessException { ensureWindowsSupport(NativeFunction.WINDOWS_PROCESS); return nativeWindowsSupport.getWindowsProcesses(); }
/** * Move a Windows File using native win32 library * * @param fromFile * @param toFile * @return * @throws hudson.util.jna.Native.NativeExecutionException */ public void windowsMoveFile(File fromFile, File toFile) throws NativeAccessException { ensureWindowsSupport(NativeFunction.WINDOWS_FILE_MOVE); nativeWindowsSupport.windowsMoveFile(fromFile, toFile); }
/** * Run the Windows program natively in an elevated privilege * * @param winExe, windows executable to run * @param args, arguments to pass * @param logFile, File where the logs of the process should go * @param pwd, Path of the working directory * @return int, process exit code * @throws hudson.util.jna.Native.NativeExecutionException */ public int windowsExec(File winExe, String args, String logFile, File pwd) throws NativeAccessException { ensureWindowsSupport(NativeFunction.WINDOWS_EXEC); return nativeWindowsSupport.windowsExec(winExe, args, logFile, pwd); }