Interface RepoPath

  • All Superinterfaces:
    Info, Serializable
    All Known Subinterfaces:
    RemoteRepoPath

    public interface RepoPath
    extends Info
    Holds a compound path of a repository key and a path within that repository, separated by a ':'
    Author:
    Fred Simon
    • Method Detail

      • getRepoKey

        @Nonnull
        String getRepoKey()
        Returns:
        The repository key
      • getPath

        String getPath()
        Returns the path within the repository - this excludes the repository key and includes the folder/file name.

        For instance, for the path 'repoKey/path/to/file' this method will return 'path/to/file'.

        Returns:
        The path inside the repository. Empty string if repo path points to the root repo path.
      • getId

        String getId()
        Returns:
        The full repository path, like "repoKey:path/to"
      • toPath

        String toPath()
        A path composed of the repository key and path.
         repoKey = "key", path = "path/to" returns "key/path/to"
         repoKey = "key", name = "" returns "key/"
         
        Returns:
        A path composed of the repository key and path
      • getName

        String getName()
        Returns:
        The name of the path as if it were a file (the string after the last '/' or '\')
      • getParent

        @Nullable
        RepoPath getParent()
        Returns:
        The repo path of the parent folder to this path. Null if this is the root path of the repository.
      • isRoot

        boolean isRoot()
        Returns:
        True if this repo path is the root path of the repository (i.e., the path part is empty)
      • isFile

        boolean isFile()
        Whether this repo path is a path to a file, rather than a folder. Note that this function does not query Artifactory for this information, but will usually instead just look at the way the path is formatted: if path ends with a '/' character, it is considered a folder, and if not, it is considered a file.
        Returns:
        True if this repo path represents a file
      • isFolder

        boolean isFolder()
        Whether this repo path is a path to a folder, rather than a file. Note that this function does not query Artifactory for this information, but will usually instead just look at the way the path is formatted: if path ends with a '/' character, it is considered a folder, and if not, it is considered a file.
        Returns:
        True if this repo path represents a folder
      • isChildOf

        boolean isChildOf​(@Nonnull
                          RepoPath parentPath)
        Whether this repoPath is a subset of provided parent path ex. given /FolderA/FolderB/file isChildOf(/FolderA/FolderB) -> true isChildOf(/FolderA/FolderC) -> false