Package org.artifactory.repo
Interface Repositories
public interface Repositories
Public API for working with repositories
- Author:
- Fred Simon
-
Method Summary
Modifier and TypeMethodDescriptionCopies the source repoPath to the targetRepoPathcopyAtomic
(RepoPath source, RepoPath target) Copies the source repoPath to the targetRepoPath , Directories are copied recursively in a single transaction, which might be resource intensive when copying very large directories.Deletes the specified repoPath.deleteAtomic
(RepoPath repoPath) Deletes the specified repoPath.void
deleteProperty
(RepoPath repoPath, String propertyName) Deletes the property from the item.deploy
(RepoPath repoPath, InputStream inputStream) Deploy an artifactboolean
getArtifactRepoPath
(FileLayoutInfo layoutInfo, String repoKey) Returns actual repository path for layout information (group, artifact, version, etc.) of an artifact as it is built according to the layout of the repository.long
getArtifactsCount
(RepoPath repoPath) Returns the total number of file artifacts under the provided directory repo path.long
getArtifactsSize
(RepoPath repoPath) Returns the total storage size of the file artifacts under the given directory repo path.getChildren
(RepoPath repoPath) getContent
(RepoPath repoPath) Get a stream handle for the file contentgetDescriptorRepoPath
(FileLayoutInfo layoutInfo, String repoKey) Returns actual repository path for layout information (group, artifact, version, etc.) of a descriptor as it is built according to the layout of the repository.Returns a list of keys of federated repositoriesgetFileInfo
(RepoPath repoPath) getItemInfo
(RepoPath repoPath) getLayoutInfo
(RepoPath repoPath) Returns module related information (group, artifact, version, etc.) for given file, as it was extracted according to the layout of the repository the file is part of.Returns a list of keys of local repositoriesgetProperties
(RepoPath repoPath) getProperty
(RepoPath repoPath, String propertyName) getPropertyValues
(RepoPath repoPath, String propertyName) Returns a list of keys of remote repositoriesgetRepositoryConfiguration
(String repoKey) Returns statistics for therepoPath
, which include downloads count, last download time and last downloader's name.getStringContent
(FileInfo fileInfo) Deprecated.getStringContent
(RepoPath repoPath) Get the content of a file as a stringReturns a list of keys of virtual repositoriesboolean
hasProperty
(RepoPath repoPath, String propertyName) boolean
isLcoalRepoPathHandled
(RepoPath repoPath) Deprecated.UseisRepoPathHandled(RepoPath)
()}boolean
isLocalRepoPathAccepted
(RepoPath repoPath) Deprecated.UseisRepoPathAccepted(RepoPath)
()}boolean
isRepoPathAccepted
(RepoPath repoPath) Checks if the specified repoPath is accepted by the include/exclude rules of the repoPath's repository.boolean
isRepoPathHandled
(RepoPath repoPath) Checks if the specified repoPath is handled by the snapshot(integration)/release policy of the repoPath's repository.Moves the source repoPath to the targetRepoPathmoveAtomic
(RepoPath source, RepoPath target) Moves the source repoPath to the targetRepoPath , Directories are moved recursively in a single transaction, which might be resource intensive when moving very large directories.setProperty
(RepoPath repoPath, String propertyName, String... values) setPropertyRecursively
(RepoPath repoPath, String propertyName, String... values) translateFilePath
(RepoPath source, String targetRepoKey) Translates the path of a file from source repository layout to target's one.Deprecated.UsedeleteAtomic(RepoPath)
ordelete(RepoPath)
instead
-
Method Details
-
getLocalRepositories
Returns a list of keys of local repositories- Returns:
- keys of local repositories
-
getFederatedRepositories
Returns a list of keys of federated repositories- Returns:
- keys of federated repositories
-
getRemoteRepositories
Returns a list of keys of remote repositories- Returns:
- keys of remote repositories
-
getVirtualRepositories
Returns a list of keys of virtual repositories- Returns:
- keys of virtual repositories
-
getRepositoryConfiguration
-
getItemInfo
- Parameters:
repoPath
- Repository path of the item- Returns:
- Folder or file info. Throws exception if the path doesn't exist.
-
getFileInfo
- Parameters:
repoPath
- Repository path of the file- Returns:
- The file info. Throws exception if the path doesn't exist or it doesn't point to a file.
-
getChildren
-
getStringContent
Deprecated.UsegetStringContent(RepoPath)
()}Get the content of a file as a string- Returns:
- The file's content as string
-
getStringContent
Get the content of a file as a string- Parameters:
repoPath
- The repoPath of the file- Returns:
- The file's content as string
- Since:
- 2.4.0
-
getContent
Get a stream handle for the file content- Parameters:
repoPath
- The repoPath of the file- Returns:
- The content stream handle for an existing file or a null-stream handler for a non exiting one.
Note: The user must manually callResourceStreamHandle.close()
on the resourceStreamHandle after usage, to avoid leaking resources! - Since:
- 2.4.0
-
getProperties
-
hasProperty
-
getPropertyValues
-
getProperty
-
setProperty
-
setPropertyRecursively
-
deleteProperty
Deletes the property from the item.- Parameters:
repoPath
- The item repo pathpropertyName
- Property name to delete
-
exists
-
deploy
Deploy an artifact- Returns:
- The result status for the deploy operation
-
delete
Deletes the specified repoPath. Directories are deleted recursively in multiple transactions.- Parameters:
repoPath
- The repository path to delete- Returns:
- Deletion status
- Since:
- 3.7.0
-
deleteAtomic
Deletes the specified repoPath. Directories are deleted recursively in a single transaction, which might be resource intensive when deleting very large directories.- Parameters:
repoPath
- The repository path to delete- Returns:
- Deletion status
- Since:
- 2.4.0
-
undeploy
Deprecated.UsedeleteAtomic(RepoPath)
ordelete(RepoPath)
instead- Parameters:
repoPath
- The repository path to delete- Returns:
- Result of the undeploy operation
-
isRepoPathHandled
Checks if the specified repoPath is handled by the snapshot(integration)/release policy of the repoPath's repository.- Returns:
- True if repoPath is handled by the snapshot(integration)/release policy of the repoPath's repository
-
isLcoalRepoPathHandled
Deprecated.UseisRepoPathHandled(RepoPath)
()} -
isRepoPathAccepted
Checks if the specified repoPath is accepted by the include/exclude rules of the repoPath's repository.- Returns:
- True if the specified repoPath is accepted by the include/exclude rules of the repoPath's repository
-
isLocalRepoPathAccepted
Deprecated.UseisRepoPathAccepted(RepoPath)
()} -
move
Moves the source repoPath to the targetRepoPath- Parameters:
source
- - A source repository pathtarget
- - A target repository path- Returns:
- The result status for the move operation
-
moveAtomic
Moves the source repoPath to the targetRepoPath , Directories are moved recursively in a single transaction, which might be resource intensive when moving very large directories.- Parameters:
source
- - A source repository pathtarget
- - A target repository path- Returns:
- The result status for the move operation
-
copy
Copies the source repoPath to the targetRepoPath- Parameters:
source
- - A source repository pathtarget
- - A target repository path- Returns:
- The result status for the copy operation
-
copyAtomic
Copies the source repoPath to the targetRepoPath , Directories are copied recursively in a single transaction, which might be resource intensive when copying very large directories.- Parameters:
source
- - A source repository pathtarget
- - A target repository path- Returns:
- The result status for the copy operation
-
getLayoutInfo
Returns module related information (group, artifact, version, etc.) for given file, as it was extracted according to the layout of the repository the file is part of. * @param repoPath the file path- Returns:
- the file layout information, which can be empty in case of incorrect repoPath or when the layout can't be determined
-
translateFilePath
Translates the path of a file from source repository layout to target's one.- Parameters:
source
- the source repository pathtargetRepoKey
- the target repository key- Returns:
- the file path according to target repository layout
-
getArtifactRepoPath
Returns actual repository path for layout information (group, artifact, version, etc.) of an artifact as it is built according to the layout of the repository.- Parameters:
layoutInfo
- the layout information to build the path fromrepoKey
- the repository the path will be in- Returns:
- the repository path to the file
-
getDescriptorRepoPath
Returns actual repository path for layout information (group, artifact, version, etc.) of a descriptor as it is built according to the layout of the repository.- Parameters:
layoutInfo
- the layout information to build the path fromrepoKey
- the repository the path will be in- Returns:
- the repository path to the file
-
getArtifactsCount
Returns the total number of file artifacts under the provided directory repo path. Repository root repo path will return the total number of artifacts in the given repository.- Parameters:
repoPath
- Repo path to count artifacts under- Returns:
- Total number of artifacts under the given repo path.
-
getArtifactsSize
Returns the total storage size of the file artifacts under the given directory repo path.- Parameters:
repoPath
- Repo path to return total storage under- Returns:
- Total size (in bytes) of the artifacts under the given repo path
-
getStats
Returns statistics for therepoPath
, which include downloads count, last download time and last downloader's name.- Parameters:
repoPath
- to return downloads statistics for- Returns:
StatsInfo
which provides data about downloads, may be null
-
getStringContent(RepoPath)
()}