mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V2.2 to HEAD
11106: Leniency in AVM CAL upgrade to avoid customer upgrade issues ACT-4500 11129: ETWOTWO-460 Service Port for alfresco runtime 11144: Proper clean-up of deleted node's properties and aspects 11146: Modifications to enable 'alternatives' when running patches 11153: Fixed masked NPE when checking 'alternative' patches 11154: Some neat reporting when a patch doesn't execute as a result of an alternative patch having run 11161: ETWOTWO-91 11163: ETWOTWO-733: CheckOutCheckInService.getWorkingCopy(NodeRef) returns nodes ... 11165: Merged V2.1 to V2.2 10983: Close stream for audit config 11192: ETWOTWO-169 - Editing FSR Deployment Receiver causes password to be lost 11210: Merge of refactored AVM Filesystem storeCreated Processing from 2.1 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@11227 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -369,35 +369,66 @@ public class HibernateAuditDAO extends HibernateDaoSupport implements AuditDAO,
|
||||
}
|
||||
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;
|
||||
InputStream current = null;
|
||||
InputStream last = null;
|
||||
try
|
||||
{
|
||||
while ((currentValue != -1) && (lastValue != -1) && (currentValue == lastValue))
|
||||
current = new BufferedInputStream(auditInfo.getAuditConfiguration().getInputStream());
|
||||
ContentReader reader = contentStore.getReader(auditConfig.getConfigURL());
|
||||
reader.setMimetype(MimetypeMap.MIMETYPE_XML);
|
||||
reader.setEncoding("UTF-8");
|
||||
last = new BufferedInputStream(reader.getContentInputStream());
|
||||
int currentValue = -2;
|
||||
int lastValue = -2;
|
||||
try
|
||||
{
|
||||
currentValue = current.read();
|
||||
lastValue = last.read();
|
||||
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);
|
||||
}
|
||||
if (currentValue != lastValue)
|
||||
{
|
||||
// Files are different - require a new entry
|
||||
auditConfig = createNewAuditConfigImpl(auditInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
// No change
|
||||
}
|
||||
}
|
||||
catch (IOException e)
|
||||
finally
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Failed to read and validate current audit configuration against the last", e);
|
||||
}
|
||||
if (currentValue != lastValue)
|
||||
{
|
||||
// Files are different - require a new entry
|
||||
auditConfig = createNewAuditConfigImpl(auditInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
// No change
|
||||
if (current != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
current.close();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
s_logger.warn(e);
|
||||
}
|
||||
}
|
||||
|
||||
if (last != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
last.close();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
s_logger.warn(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user