本文整理了Java中org.apache.jackrabbit.oak.api.Root.getBlob
方法的一些代码示例,展示了Root.getBlob
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Root.getBlob
方法的具体详情如下:
包路径:org.apache.jackrabbit.oak.api.Root
类名称:Root
方法名:getBlob
[英]Get a blob by its reference.
[中]通过其引用获取一个blob。
代码示例来源:origin: apache/jackrabbit-oak
@Nullable
@Override
public Blob getBlob(@NotNull String reference) {
return base.getBlob(reference);
}
代码示例来源:origin: apache/jackrabbit-oak
@Override
@NotNull
public Value createValue(@NotNull Binary value) {
try {
if (value instanceof BinaryImpl) {
// No need to create the value again if we have it already underlying the binary
return ((BinaryImpl) value).getBinaryValue();
} else if (value instanceof ReferenceBinary) {
String reference = ((ReferenceBinary) value).getReference();
Blob blob = root.getBlob(reference);
if (blob != null) {
return createBinaryValue(blob);
}
}
InputStream stream = value.getStream();
if (stream == null) {
throw new ValueFormatException("null");
}
return createBinaryValue(stream);
} catch (RepositoryException e) {
return new ErrorValue(e, PropertyType.BINARY);
} catch (IOException e) {
return new ErrorValue(e, PropertyType.BINARY);
}
}
代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak
@Override
public Value createValue(Binary value) {
try {
if (value instanceof BinaryImpl) {
// No need to create the value again if we have it already underlying the binary
return ((BinaryImpl) value).getBinaryValue();
} else if (value instanceof ReferenceBinary) {
String reference = ((ReferenceBinary) value).getReference();
Blob blob = root.getBlob(reference);
if (blob != null) {
return createBinaryValue(blob);
}
}
return createBinaryValue(value.getStream());
} catch (RepositoryException e) {
return new ErrorValue(e, PropertyType.BINARY);
} catch (IOException e) {
return new ErrorValue(e, PropertyType.BINARY);
}
}
内容来源于网络,如有侵权,请联系作者删除!