Search in sources :

Example 1 with FilesystemCasObject

use of org.platformlayer.ops.cas.filesystem.FilesystemCasObject in project platformlayer by platformlayer.

the class OpsCasObjectBase method copyTo.

@Override
public void copyTo(CasTarget destTarget, File destPath, CasStore stagingStore) throws OpsException {
    CasLocation srcLocation = getLocation();
    CasLocation destLocation = destTarget.getLocation();
    int distance = srcLocation.estimateDistance(destLocation);
    log.info("Estimated distance from " + srcLocation + " to " + destLocation + " => " + distance);
    if (distance == 0) {
        log.info("Distance was zero; copying directly");
        this.copyTo0(OpsCasTarget.getTarget(destTarget), destPath);
        return;
    }
    if (stagingStore != null) {
        log.info("Staging object " + this + " to " + stagingStore);
        FilesystemCasObject staged = ((FilesystemCasStore) stagingStore).copyToStaging(this);
        staged.copyTo(destTarget, destPath, null);
    } else {
        log.info("Copying object from " + this + " to " + destTarget);
        this.copyTo0(OpsCasTarget.getTarget(destTarget), destPath);
    }
}
Also used : FilesystemCasStore(org.platformlayer.ops.cas.filesystem.FilesystemCasStore) FilesystemCasObject(org.platformlayer.ops.cas.filesystem.FilesystemCasObject) CasLocation(org.platformlayer.cas.CasLocation)

Aggregations

CasLocation (org.platformlayer.cas.CasLocation)1 FilesystemCasObject (org.platformlayer.ops.cas.filesystem.FilesystemCasObject)1 FilesystemCasStore (org.platformlayer.ops.cas.filesystem.FilesystemCasStore)1