com.bertramlabs.plugins.karman.differential.DifferentialStorageProvider.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of karman-differential Show documentation
Show all versions of karman-differential Show documentation
Karman Storage Provider interface for differential file storage
package com.bertramlabs.plugins.karman.differential
import com.bertramlabs.plugins.karman.DirectoryInterface
import com.bertramlabs.plugins.karman.Directory
import com.bertramlabs.plugins.karman.StorageProvider
class DifferentialStorageProvider extends StorageProvider {
static String providerName = "differential"
Integer blockSize = 1024 * 1024 * 1 //1 megabytes per block
StorageProvider sourceProvider
/**
* Get a list of directories within the storage provider (i.e. Buckets/Containers)
* @return List of {@link com.bertramlabs.plugins.karman.Directory} Classes.
*/
@Override
Directory getDirectory(String name) {
DirectoryInterface dir = sourceProvider.getDirectory(name)
if(dir) {
return new DifferentialDirectory(name, this, dir)
} else {
return null
}
}
@Override
List getDirectories() {
return sourceProvider.getDirectories()?.collect { DirectoryInterface dir ->
new DifferentialDirectory(dir.name, this, dir)
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy