/** * Check if this Java process can be restarted * * @throws hudson.util.jna.Native.NativeExecutionException */ public boolean canRestartJavaProcess() throws NativeAccessException { ensureUnixSupport(NativeFunction.JAVA_RESTART); return nativeUnixSupport.canRestartJavaProcess(); }
/** * Check if PAM Authentication available in the machine where this program * runs * * @return Message corresponding to the availability of PAM * @throws hudson.util.jna.Native.NativeExecutionException */ public String checkPamAuthentication() throws NativeAccessException { ensureUnixSupport(NativeFunction.PAM); return nativeUnixSupport.checkPamAuthentication(); }
/** * Check if this Unix group exists on the machine where this program runs * * @param userName * @return * @throws hudson.util.jna.Native.NativeExecutionException */ public boolean checkUnixGroup(String groupName) throws NativeAccessException { ensureUnixSupport(NativeFunction.UNIX_GROUP); return nativeUnixSupport.checkUnixGroup(groupName); }
/** * Do the Unix style chown (change Owner permission) on a File * * @param file * @param mask * @return true if the function executed successfully * @throws hudson.util.jna.Native.ExecutionError */ public boolean chown(File file, int uid, int gid) throws NativeAccessException { ensureUnixSupport(NativeFunction.CHOWN); return nativeUnixSupport.chown(file, uid, gid); }
/** * Do the Unix style chmod (change file permission) on a File * * @param file * @param mask * @return true if the function executed successfully * @throws hudson.util.jna.Native.ExecutionError */ public boolean chmod(File file, int mask) throws NativeAccessException { ensureUnixSupport(NativeFunction.CHMOD); return nativeUnixSupport.chmod(file, mask); }
/** * Get the effective User ID on a Unix System * * @return * @throws hudson.util.jna.Native.ExecutionError */ public int getEuid() throws NativeAccessException { ensureUnixSupport(NativeFunction.EUID); return nativeUnixSupport.getEuid(); }
/** * Get the effective Group ID on a Unix System * * @return * @throws hudson.util.jna.Native.ExecutionError */ public int getEgid() throws NativeAccessException { ensureUnixSupport(NativeFunction.EGID); return nativeUnixSupport.getEgid(); }
/** * Create Unix style symlink * * @param targetPath * @param file * @return true if the operation is successful * @throws hudson.util.jna.Native.ExecutionError */ public boolean createSymlink(String targetPath, File file) throws NativeAccessException { ensureUnixSupport(NativeFunction.SYMLINK); return nativeUnixSupport.createSymlink(targetPath, file); }
/** * Check if this Unix user exists on the machine where this program runs * * @param userName * @return * @throws hudson.util.jna.Native.NativeExecutionException */ public boolean checkUnixUser(String userName) throws NativeAccessException { ensureUnixSupport(NativeFunction.UNIX_USER); return nativeUnixSupport.checkUnixUser(userName); }
private List<NativeUnixSupport> getAvailableNativeUnixSupports() { List<NativeUnixSupport> nativeUnixSupports = new ArrayList<NativeUnixSupport>(); if (NativeUnixSupport.all() != null && !NativeUnixSupport.all().isEmpty()) { for (Descriptor<NativeUnixSupport> nativeUnixSupport : NativeUnixSupport.all()) { try { nativeUnixSupports.add(nativeUnixSupport.newInstance(null, null)); } catch (Throwable exc) { logger.info("Failed to instantiate Native Unix Support - " + nativeUnixSupport.getDisplayName()); } } } return nativeUnixSupports; }