Class ResolvePathAbsolute

Object
ResolvePathAbsolute

public class ResolvePathAbsolute extends Object
More advanced implementation of Path.resolve(java.nio.file.Path).

It will always return an absolute-path.

If the base-path is a file, rather than a directory, it will consider only the directory component, and otherwise proceed.

Author:
Owen Feehan
  • Method Details

    • resolve

      public static Path resolve(Path basePath, Path toJoin)
      Like Path.resolve(java.nio.file.Path) but with some additional quirks.

      Please see the class-description.

      Parameters:
      basePath - the base path onto which relativePathToJoin is joined. It it's a path to a file, only the directory component is used.
      toJoin - normally a relative-path (relative to basePath but it can also be an absolute-path.
      Returns:
      an absolute-path to a combination of basePath and toJoin, or toJoin alone if it's absolute.