osgi - 是否可以在 CQ5 中获取节点或吊索资源的 CRC?

标签 osgi aem jcr sling

我正在尝试从具有资源或节点内 cq5 内属性的资源或节点获取字节的 CRC 或 md5。

例如,假设我有一个 DAM Assets ,我想获取包含图像数据的字节 blob 的 MD5 指纹,以便我知道内部数据何时发生更改。

对于节点来说同样会很方便。 CQ5 中是否有任何内置方法可以实现此目的?

最佳答案

您是否尝试过将“etag”混合添加到您想要校验和的节点中?引用the spec on the etag mixin :

A jcr:etag property is an opaque string whose syntax is identical to that defined for entity tags in HTTP/1.1. Semantically, the jcr:etag is comparable to the HTTP/1.1 strong entity tag.

On creation of a mix:etag node N, or assignment of mix:etag to N, the repository must create a jcr:etag property with an implementation determined value.

The value of the jcr:etag property must change immediately on persist of any of the following changes to N:

  • A BINARY property is added to N.
  • A BINARY property is removed from N.
  • The value of an existing BINARY property of N changes.

关于osgi - 是否可以在 CQ5 中获取节点或吊索资源的 CRC?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18381100/

相关文章:

xpath - 使用Querybuilder从结果中排除标签

java - OSGI 容器中的数据源

java - 运行 OSGI 框架时出现 bundle 异常

java - Maven 无法解决与某些特定版本的 jar 的依赖关系

apache - 我们可以在 apache 2.4 中创建自定义日志文件吗?

java - 在 Magnolia/JCR-SQL2 中获取所有 sibling ,上一个和下一个

java - Jackrabbit,保存很多文档太慢了

osgi - 如何在 jboss 中将 OSGI 与 CDI 一起使用?

java - 如何启动 JavaFx OSGi 包