/** * Get the error associated with the last Native Unix Operation * * @return String error message */ public String getLastMacError() { return nativeMacSupport.getLastError(); }
/** * Get the Native processes of a Mac System * * @return * @throws hudson.util.jna.Native.NativeExecutionException */ public List<NativeProcess> getMacProcesses() throws NativeAccessException { ensureMacSupport(NativeFunction.MAC_PROCESS); return nativeMacSupport.getMacProcesses(); }
private List<NativeMacSupport> getAvailableNativeMacSupports() { List<NativeMacSupport> nativeMacSupports = new ArrayList<NativeMacSupport>(); if (NativeMacSupport.all() != null && !NativeMacSupport.all().isEmpty()) { for (Descriptor<NativeMacSupport> nativeMacSupport : NativeMacSupport.all()) { try { nativeMacSupports.add(nativeMacSupport.newInstance(null, null)); } catch (Throwable exc) { logger.info("Failed to instantiate Native Mac Support - " + nativeMacSupport.getDisplayName()); } } } return nativeMacSupports; }
private void ensureMacSupport(NativeFunction function) throws NativeAccessException { if (!hasMacSupport()) { throw new NativeAccessException("Native Mac Support plugin not installed"); } if (!nativeMacSupport.hasSupportFor(function)) { throw new NativeAccessException("Installed Native Mac Support plugin does not support " + function); } }