ALF-11828 CIFS: NPE possible after connection failure

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@32472 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2011-12-02 13:46:53 +00:00
parent 26e0b0a765
commit e74e27c982

View File

@@ -2803,25 +2803,20 @@ public class ContentDiskDriver2 extends AlfrescoDiskDriver implements ExtendedD
/*
* Need to work out whether content has changed. Some odd situations do not change content.
*/
boolean contentChanged = true;
ContentReader existingContent = contentService.getReader(target, ContentModel.PROP_CONTENT);
if(existingContent != null)
{
existingContent.getSize();
existingContent.getMimetype();
InputStream is = existingContent.getContentInputStream();
contentChanged = isContentChanged(existingContent, tempFile);
}
//InputStream is = new BufferedInputStream(new FileInputStream(tempFile.getFile()));
boolean contentChanged = isContentChanged(existingContent, tempFile);
if(contentChanged)
{
logger.debug("content has changed");
// MER END
/**
* Take over the behaviour of the auditable aspect
*/
@@ -2853,7 +2848,7 @@ public class ContentDiskDriver2 extends AlfrescoDiskDriver implements ExtendedD
writer.setMimetype(mimetype);
writer.setEncoding(encoding);
writer.putContent(tempFile.getFile());
}
} // if content changed
}
}