直接在FileNet(Oracle或IBM DB2(使用的数据库上搜索对象会提供十六进制ID,如下所示:
F324E0C2A4AA884FACAAE6918AFFB163
如何使用Java API将它们转换为FileNet使用的GUID标准?结果示例:
{C2E024F3-AAA4-4F88-ACAA-E6918AFFB163}
public static String hexToGUID(String hex) {
return "{" + hex.substring(6, 8) + hex.substring(4, 6) + hex.substring(2, 4) + hex.substring(0, 2) + "-"
+ hex.substring(10, 12) + hex.substring(8, 10) + "-" + hex.substring(14, 16) + hex.substring(12, 14)
+ "-" + hex.substring(16, 18) + hex.substring(18, 20) + "-" + hex.substring(20, 22)
+ hex.substring(22, 24) + hex.substring(24, 26) + hex.substring(26, 28) + hex.substring(28, 30)
+ hex.substring(30, 32) + "}";
}