Class WindowsRemoteProcessUtils

java.lang.Object
org.metricshub.wmi.windows.remote.WindowsRemoteProcessUtils

public class WindowsRemoteProcessUtils extends Object
  • Method Details

    • getWindowsEncodingCharset

      public static Charset getWindowsEncodingCharset(WindowsRemoteExecutor windowsRemoteExecutor, long timeout) throws TimeoutException, WqlQuerySyntaxException, WindowsRemoteException
      Get the CharSet from the Win32_OperatingSystem CodeSet. (if not found by default Latin-1 windows-1252)
      Parameters:
      windowsRemoteExecutor - WindowsRemoteExecutor instance
      timeout - Timeout in milliseconds.
      Returns:
      the encoding charset from Win32_OperatingSystem
      Throws:
      TimeoutException - To notify userName of timeout
      WqlQuerySyntaxException - On WQL syntax errors
      WindowsRemoteException - For any problem encountered on remote
      See Also:
    • buildNewOutputFileName

      public static String buildNewOutputFileName()
      Builds a new output file name, with 99.9999999% chances of being unique on the remote system
      Returns:
      file name
    • copyLocalFilesToShare

      public static String copyLocalFilesToShare(String command, List<String> localFiles, String uncSharePath, String remotePath) throws IOException
      Copy the local files to the share and update the command with their path as seen in the remote system.
      Parameters:
      command - The command (mandatory)
      localFiles - The local files to copy list
      uncSharePath - The UNC path of the share
      remotePath - The remote path
      Returns:
      The updated command.
      Throws:
      IOException - If an I/O error occurs.