Package org.artifactory.repo
Interface RepoPath
-
- All Superinterfaces:
Info,java.io.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 charARCHIVE_SEPstatic charPATH_SEPARATORstatic java.lang.StringREMOTE_CACHE_SUFFIXstatic charREPO_PATH_SEP
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetId()java.lang.StringgetName()RepoPathgetParent()java.lang.StringgetPath()java.lang.StringgetRepoKey()booleanisFile()Whether this repo path is a path to a file, rather than a folder.booleanisFolder()Whether this repo path is a path to a folder, rather than a file.booleanisRoot()java.lang.StringtoPath()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 java.lang.String REMOTE_CACHE_SUFFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
getRepoKey
@Nonnull java.lang.String getRepoKey()
- Returns:
- The repository key
-
getPath
java.lang.String getPath()
- Returns:
- The path inside the repository. Empty string if repo path points to the root repo path
-
getId
java.lang.String getId()
- Returns:
- The full repository path, like "repoKey:path/to"
-
toPath
java.lang.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
java.lang.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
-
-