Interface Path

All Known Implementing Classes:
SimplePath

public interface Path
A bean representation of a path
  • Method Details

    • getParent

      @Nullable String getParent()
      Returns:
      the parent string - everything up to the last component, or an empty string if root
    • getName

      @Nonnull String getName()
      Returns:
      everything after the last "/" (the last component), including the extension, or an empty string if there are no components
    • getExtension

      @Nullable String getExtension()
      Returns:
      the file extension of the path (with no .), or null if there is no file extension
    • getComponents

      @Nonnull String[] getComponents()
      Returns:
      an array of Strings representing the directories followed by a possible file name
    • toString

      @Nonnull String toString()
      Overrides:
      toString in class Object
      Returns:
      a string representation of the path - the components separated by "/"s