You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
storage-manager-core/src/main/java/org/gcube/contentmanagement/blobstorage/service/impl/AmbiguousResource.java

34 lines
957 B
Java

package org.gcube.contentmanagement.blobstorage.service.impl;
import org.gcube.contentmanagement.blobstorage.resource.MyFile;
import org.gcube.contentmanagement.blobstorage.resource.OperationDefinition.LOCAL_RESOURCE;
/**
* This class is used from methods that can have both a RemoteResource or a LocalResource
*
* @author Roberto Cirillo (ISTI-CNR)
*
*/
public class AmbiguousResource extends RemoteResource {
public AmbiguousResource(MyFile file, ServiceEngine engine) {
super(file, engine);
}
/**
* define local resource
* @param path : local absolute path of resource
* @return remoteResource object
*/
public RemoteResource LFile(String path){
if(getMyFile() != null){
getMyFile().setLocalPath(path);
}else{
setMyFile(setGenericProperties("", "", path, "local"));
getMyFile().setLocalPath(path);
}
getMyFile().setLocalResource(LOCAL_RESOURCE.PATH);
return new RemoteResource(getMyFile(), getEngine());
}
}