@Override
public ClientRequest migrate(PersistentRequestClient newClient, ObjectContainer container,
NodeClientCore core) throws IdentifierCollisionException, NotAllowedException,
IOException, MetadataUnresolvedException, ResumeFailedException {
ClientContext context = core.clientContext;
if(targetURI != null)
container.activate(targetURI, Integer.MAX_VALUE);
if(uri != null)
container.activate(uri, Integer.MAX_VALUE);
container.activate(ctx, Integer.MAX_VALUE);
ctx.onResume();
File f = origFilename;
if(f != null) {
container.activate(f, Integer.MAX_VALUE);
f = new File(f.toString());
if(!f.exists()) {
Logger.error(this, "Not migrating insert as data has been deleted");
return null;
}
}
container.activate(clientMetadata, Integer.MAX_VALUE);
RandomAccessBucket data;
if(this.data != null) {
container.activate(this.data, Integer.MAX_VALUE);
if(this.data.size() == 0) {
Logger.error(this, "No data migrating insert: "+this.data);
return null;
}
this.data.onResume(context);
data = BucketTools.toRandomAccessBucket(this.data, context.getBucketFactory(true));
} else {
Logger.error(this, "Not migrating insert as data has been deleted (or very old download?)");
return null;
}
byte[] overrideSplitfileKey = null;