if(finished) return null;
}
if(persistent) {
if(sourceData == null) {
Logger.error(this, "getBlockItem(): sourceData = null", new Exception("error"));
fail(new InsertException(InsertExceptionMode.INTERNAL_ERROR), context);
return null;
}
}
Bucket data = sourceData.createShadow();
FreenetURI u = uri;
if(u.getKeyType().equals("CHK")) u = FreenetURI.EMPTY_CHK_URI;
if(data == null) {
data = context.tempBucketFactory.makeBucket(sourceData.size());
BucketTools.copy(sourceData, data);
}
CompatibilityMode cmode = ctx.getCompatibilityMode();
boolean pre1254 = !(cmode == CompatibilityMode.COMPAT_CURRENT || cmode.ordinal() >= CompatibilityMode.COMPAT_1255.ordinal());
return new BlockItem(key, data, isMetadata, compressionCodec, sourceLength, u, persistent, pre1254, cryptoAlgorithm, cryptoKey);
} catch (IOException e) {
throw new InsertException(InsertExceptionMode.BUCKET_ERROR, e, null);
}
}