Class PathRelativeIO

java.lang.Object
com.helger.io.relative.PathRelativeIO
All Implemented Interfaces:
IPathRelativeIO

@Immutable public class PathRelativeIO extends Object implements IPathRelativeIO
Default implementation of IPathRelativeIO.
Author:
Philip Helger
  • Constructor Details

    • PathRelativeIO

      public PathRelativeIO(@Nonempty @NonNull @Nonempty String sBasePath)
      Constructor.
      Parameters:
      sBasePath - The base path to use. May neither be null nor empty.
  • Method Details

    • getBasePath

      @Nonempty public @NonNull @Nonempty String getBasePath()
      Specified by:
      getBasePath in interface IPathRelativeIO
      Returns:
      The base path. May be a file path, a URL or whatever. Never null.
    • getBaseURL

      @Nonempty public @NonNull @Nonempty String getBaseURL()
      Returns:
      The base URL derived from the base path. Neither null nor empty.
    • getResource

      public @NonNull IReadableResource getResource(@Nonempty @NonNull @Nonempty String sRelativePath)
      Get the file system resource relative to the base path. This method CAN NOT handle absolute paths!
      Specified by:
      getResource in interface IPathRelativeIO
      Parameters:
      sRelativePath - the relative path
      Returns:
      The "absolute" IReadableResource and never null.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object