Package org.artifactory.repo
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
-
-
Field Summary
Fields Modifier and Type Field Description static char
ARCHIVE_SEP
static char
PATH_SEPARATOR
static String
REMOTE_CACHE_SUFFIX
static char
REPO_PATH_SEP
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getId()
String
getName()
RepoPath
getParent()
String
getPath()
Returns the path within the repository - this excludes the repository key and includes the folder/file name.String
getRepoKey()
boolean
isChildOf(RepoPath parentPath)
Whether this repoPath is a subset of provided parent path ex.boolean
isFile()
Whether this repo path is a path to a file, rather than a folder.boolean
isFolder()
Whether this repo path is a path to a folder, rather than a file.boolean
isRoot()
String
toPath()
A path composed of the repository key and path.
-
-
-
Field Detail
-
REPO_PATH_SEP
static final char REPO_PATH_SEP
- See Also:
- Constant Field Values
-
ARCHIVE_SEP
static final char ARCHIVE_SEP
- See Also:
- Constant Field Values
-
PATH_SEPARATOR
static final char PATH_SEPARATOR
- See Also:
- Constant Field Values
-
REMOTE_CACHE_SUFFIX
static final String REMOTE_CACHE_SUFFIX
- See Also:
- Constant Field Values
-
-
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
-
-