Class BapSshTransferCache


  • public class BapSshTransferCache
    extends Object
    This class allows to handle the tracking of the files transferred to the remote servers so that those upload can be skipped if possible. The files are tracked via a per-job json cache file ("remoteResourceCache.json") which contains a map of the absolute paths of the uploaded files and the values: * Last access timestamp * MD5 Hash value The files are signaled to be uploaded in two scenarios: * They were not uploaded previously, they are now tracked and uploaded * They were already uploaded before, only if the file has newer access timestamp and a *different* MD5 value they are uploaded This is done for performance reasons, large files may take a long time to compute the MD5 hash so if they are not newer then there is no need to compute it because we already know that the upload will be rejected.
    • Constructor Detail

      • BapSshTransferCache

        public BapSshTransferCache​(FilePath configPath)
    • Method Detail

      • save

        public void save()
        Writes the current memory data to the cache file as JSON
      • checkCachedResource

        public boolean checkCachedResource​(FilePath filePath)
        Checks if the resources indicated by the FilePath instance should be uploaded or not according to the cache
        Parameters:
        filePath - path of the resource
        Returns:
        true if the resource shall be uploaded, false otherwise