Class RemotePath

java.lang.Object
io.gem.agent.RemotePath

public final class RemotePath extends Object
POSIX path operations for supported Linux and macOS remote nodes.
  • Field Details

  • Method Details

    • join

      public static String join(String parent, String... children)
      Join a remote parent and one or more relative path segments.
      Parameters:
      parent - absolute or relative remote parent
      children - relative child segments
      Returns:
      joined POSIX remote path
      Throws:
      IllegalArgumentException - when no child is supplied or a child is absolute
    • parent

      public static String parent(String path)
      Return the parent of a normalized POSIX remote path.
      Parameters:
      path - remote path
      Returns:
      parent path, or the POSIX root when no non-root parent exists
    • normalize

      public static String normalize(String path)
      Remove trailing separators from a remote path while preserving the POSIX root.
      Parameters:
      path - remote path
      Returns:
      normalized path, or null for a null or blank value
    • isAbsolute

      public static boolean isAbsolute(String path)
      Test whether a remote path is absolute according to the POSIX remote-node contract.
      Parameters:
      path - remote path
      Returns:
      true when the path begins at the POSIX root