As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
private AuditConfig getAuditConfig(final AuditState auditInfo) { AuditConfig auditConfig; auditConfig = queryLatestConfig(getSession()); if (auditConfig == null) { auditConfig = createNewAuditConfigImpl(auditInfo); } else { InputStream current = new BufferedInputStream(auditInfo.getAuditConfiguration().getInputStream()); ContentReader reader = contentStore.getReader(auditConfig.getConfigURL()); reader.setMimetype(MimetypeMap.MIMETYPE_XML); reader.setEncoding("UTF-8"); InputStream last = new BufferedInputStream(reader.getContentInputStream()); int currentValue = -2; int lastValue = -2; try { while ((currentValue != -1) && (lastValue != -1) && (currentValue == lastValue)) { currentValue = current.read(); lastValue = last.read(); } } catch (IOException e) { throw new AlfrescoRuntimeException("Failed to read and validate current audit configuration against the last", e); } finally { try { current.close(); last.close(); } catch (IOException e) { e.printStackTrace(); } } if (currentValue != lastValue) { // Files are different - require a new entry auditConfig = createNewAuditConfigImpl(auditInfo); } else { // No change } } return auditConfig; }