mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user