Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Artifactory is a binaries repository manager.
   * Copyright (C) 2012 JFrog Ltd.
   *
   * Artifactory is free software: you can redistribute it and/or modify
   * it under the terms of the GNU Lesser General Public License as published by
   * the Free Software Foundation, either version 3 of the License, or
   * (at your option) any later version.
   *
  * Artifactory is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public License
  * along with Artifactory.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 package org.artifactory.repo;
 
 
 import  javax.annotation.Nullable;
 import java.util.List;
 import java.util.Set;

Public API for working with repositories
 
 @SuppressWarnings("UnusedDeclaration")
 public interface Repositories {

    
Returns a list of keys of local repositories

Returns:
keys of local repositories
 
     public List<StringgetLocalRepositories();

    
Returns a list of keys of remote repositories

Returns:
keys of remote repositories
 
     public List<StringgetRemoteRepositories();

    
Returns a list of keys of virtual repositories

Returns:
keys of virtual repositories
 
     public List<StringgetVirtualRepositories();
 

Parameters:
repoPath Repository path of the item
Returns:
Folder or file info. Throws exception if the path doesn't exist.
 
     ItemInfo getItemInfo(RepoPath repoPath);

    

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.
 
     FileInfo getFileInfo(RepoPath repoPath);
 
     List<ItemInfogetChildren(RepoPath repoPath);

    
Get the content of a file as a string

Deprecated:
Use getStringContent(RepoPath) ()}
Parameters:
fileInfo
Returns:
The file's content as string
 
     @Deprecated
     String getStringContent(FileInfo fileInfo);

    
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
 
     String getStringContent(RepoPath repoPath);

    
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 call ResourceStreamHandle.close() on the resourceStreamHandle after usage, to avoid leaking resources!
Since:
2.4.0
    Properties getProperties(RepoPath repoPath);
    boolean hasProperty(RepoPath repoPathString propertyName);
    public Set<StringgetPropertyValues(RepoPath repoPathString propertyName);
    public String getProperty(RepoPath repoPathString propertyName);
    Properties setProperty(RepoPath repoPathString propertyNameString... values);
    Properties setPropertyRecursively(RepoPath repoPathString propertyNameString... values);

    
Deletes the property from the item.

Parameters:
repoPath The item repo path
propertyName Property name to delete
    void deleteProperty(RepoPath repoPathString propertyName);
    boolean exists(RepoPath repoPath);

    
Deploy an artifact

Parameters:
repoPath
inputStream
Returns:
The result status for the deploy operation
    StatusHolder deploy(RepoPath repoPathInputStream inputStream);

    
Deletes the specified repoPath

Parameters:
repoPath The repository path to delete
Returns:
Deletion status
Since:
2.4.0
    StatusHolder delete(RepoPath repoPath);

    

Deprecated:
Use delete(RepoPath) instead
Parameters:
repoPath
Returns:
Result of the undeploy operation
    @Deprecated
    StatusHolder undeploy(RepoPath repoPath);

    
Checks if the specified repoPath is handled by the snapshot(integration)/release policy of the repoPath's repository.

Parameters:
repoPath
Returns:
True if repoPath is handled by the snapshot(integration)/release policy of the repoPath's repository
    boolean isRepoPathHandled(RepoPath repoPath);

    

Deprecated:
Use isRepoPathHandled(RepoPath) ()}
    @Deprecated
    boolean isLcoalRepoPathHandled(RepoPath repoPath);

    
Checks if the specified repoPath is accepted by the include/exclude rules of the repoPath's repository.

Parameters:
repoPath
Returns:
True if the specified repoPath is accepted by the include/exclude rules of the repoPath's repository
    boolean isRepoPathAccepted(RepoPath repoPath);


    

Deprecated:
Use isRepoPathAccepted(RepoPath) ()}
    @Deprecated
    boolean isLocalRepoPathAccepted(RepoPath repoPath);

    
Moves the source repoPath to the targetRepoPath

Parameters:
source - A source repository path
target - A target repository path
Returns:
The result status for the move operation
    StatusHolder move(RepoPath sourceRepoPath target);

    
Copies the source repoPath to the targetRepoPath

Parameters:
source - A source repository path
target - A target repository path
Returns:
The result status for the copy operation
    StatusHolder copy(RepoPath sourceRepoPath target);

    
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. *

Parameters:
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
    public FileLayoutInfo getLayoutInfo(RepoPath repoPath);

    
Translates the path of a file from source repository layout to target's one.

Parameters:
source the source repository path
targetRepoKey the target repository key
Returns:
the file path according to target repository layout
    String translateFilePath(RepoPath sourceString targetRepoKey);

    
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 from
repoKey the repository the path will be in
Returns:
the repository path to the file
    RepoPath getArtifactRepoPath(FileLayoutInfo layoutInfoString 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.

Parameters:
layoutInfo the layout information to build the path from
repoKey the repository the path will be in
Returns:
the repository path to the file
    RepoPath getDescriptorRepoPath(FileLayoutInfo layoutInfoString repoKey);

    
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.
    long getArtifactsCount(RepoPath repoPath);

    
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
    long getArtifactsSize(RepoPath repoPath);

    
Returns statistics for the repoPath, 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
    @Nullable
    StatsInfo getStats(RepoPath repoPath);
New to GrepCode? Check out our FAQ X