09-23-2008 05:22 AM
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;
}
09-25-2008 05:14 AM
10-02-2008 05:51 AM
10-06-2008 05:56 AM
10-16-2008 09:52 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.