org.jfrog.build.extractor.clientConfiguration.util
Interface DependenciesDownloader


public interface DependenciesDownloader

Actual download performer, should hold an actual client and implement it's own specific logic upon dependencies downloading


Method Summary
 java.util.List<org.jfrog.build.api.Dependency> download(java.util.Set<org.jfrog.build.api.dependency.DownloadableArtifact> downloadableArtifacts)
           
 ArtifactoryDependenciesClient getClient()
           
 java.lang.String getTargetDir(java.lang.String targetDir, java.lang.String relativeDir)
          Returns the full target dir of where the artifact is saved Usually that can be a full absolute path under the file system or the full relative path to the user workspace.
 boolean isFileExistsLocally(java.lang.String filePath, java.lang.String md5, java.lang.String sha1)
          Checks if the file path exists locally with the same MD5 and SHA-1 checksums.
 void removeUnusedArtifactsFromLocal(java.util.Set<java.lang.String> allResolvesFiles, java.util.Set<java.lang.String> forDeletionFiles)
          Receives a set of the resolved files (Those who got downloaded from Artifactory and those who were already existed locally with the same checksums) And a set of resolved files from patterns with mark for deletion (=!>) For each file, lists the files in the same directory and removes the old ones (meaning those who did not participate in the build resolution and doesn't exist in all resolved files set).
 java.util.Map<java.lang.String,java.lang.String> saveDownloadedFile(java.io.InputStream is, java.lang.String filePath)
          Parse the given input stream, save it to an actual file to the given path and return the calculated checksums for the saved file.
 void setFlatDownload(boolean flat)
          Set the flat download flag
 

Method Detail

getClient

ArtifactoryDependenciesClient getClient()

download

java.util.List<org.jfrog.build.api.Dependency> download(java.util.Set<org.jfrog.build.api.dependency.DownloadableArtifact> downloadableArtifacts)
                                                        throws java.io.IOException
Throws:
java.io.IOException

getTargetDir

java.lang.String getTargetDir(java.lang.String targetDir,
                              java.lang.String relativeDir)
                              throws java.io.IOException
Returns the full target dir of where the artifact is saved Usually that can be a full absolute path under the file system or the full relative path to the user workspace.

Throws:
java.io.IOException

saveDownloadedFile

java.util.Map<java.lang.String,java.lang.String> saveDownloadedFile(java.io.InputStream is,
                                                                    java.lang.String filePath)
                                                                    throws java.io.IOException
Parse the given input stream, save it to an actual file to the given path and return the calculated checksums for the saved file. Implementers must close the given input stream when finished.

Throws:
java.io.IOException

isFileExistsLocally

boolean isFileExistsLocally(java.lang.String filePath,
                            java.lang.String md5,
                            java.lang.String sha1)
                            throws java.io.IOException
Checks if the file path exists locally with the same MD5 and SHA-1 checksums.

Parameters:
filePath - The local file path to check
md5 - The MD5 checksum to compare with
sha1 - The SHA-1 checksum to compare with
Throws:
java.io.IOException

removeUnusedArtifactsFromLocal

void removeUnusedArtifactsFromLocal(java.util.Set<java.lang.String> allResolvesFiles,
                                    java.util.Set<java.lang.String> forDeletionFiles)
                                    throws java.io.IOException
Receives a set of the resolved files (Those who got downloaded from Artifactory and those who were already existed locally with the same checksums) And a set of resolved files from patterns with mark for deletion (=!>) For each file, lists the files in the same directory and removes the old ones (meaning those who did not participate in the build resolution and doesn't exist in all resolved files set).

Parameters:
allResolvesFiles - A set of all resolved files (to search in)
forDeletionFiles - A set of resolved files from patterns with mark for deletion (=!>)
Throws:
java.io.IOException

setFlatDownload

void setFlatDownload(boolean flat)
Set the flat download flag

Parameters:
flat - , flat download flag nva value