java.lang.Object
org.elasticsearch.entitlement.runtime.policy.FileUtils

public class FileUtils extends Object
  • Method Details

    • isAbsolutePath

      public static boolean isAbsolutePath(String path)
      Tests if a path is absolute or relative, taking into consideration both Unix and Windows conventions. Note that this leads to a conflict, resolved in favor of Unix rules: `/foo` can be either a Unix absolute path, or a Windows relative path with "wrong" directory separator (using non-canonical / in Windows). This method is intended to be used as validation for different file entitlements format: therefore it is preferable to reject a relative path that is definitely absolute on Unix, rather than accept it as a possible relative path on Windows (if that is the case, the developer can easily fix the path by using the correct platform separators).