From d9381460b2ef0a2a535d2d719ff22b39e7856434 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Thu, 26 Apr 2018 11:07:28 -0400 Subject: [PATCH] GH-177: Create SMB files only in the SHARE_READ Fixes spring-projects/spring-integration-extensions#177 * To avoid partial read, when other process may open the file and start to write, it would be better to open SMB files in the `FILE_SHARE_READ` mode. This way only one process can write the file, when all of them can read it --- .../org/springframework/integration/smb/session/SmbSession.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-integration-smb/src/main/java/org/springframework/integration/smb/session/SmbSession.java b/spring-integration-smb/src/main/java/org/springframework/integration/smb/session/SmbSession.java index c4ce3f5..babe820 100644 --- a/spring-integration-smb/src/main/java/org/springframework/integration/smb/session/SmbSession.java +++ b/spring-integration-smb/src/main/java/org/springframework/integration/smb/session/SmbSession.java @@ -458,7 +458,7 @@ public class SmbSession implements Session { return this.smbShare; } - SmbFile smbFile = new SmbFile(this.smbShare, cleanedPath); + SmbFile smbFile = new SmbFile(this.smbShare, cleanedPath, SmbFile.FILE_SHARE_READ); boolean appendFileSeparator = !cleanedPath.endsWith(SMB_FILE_SEPARATOR); if (appendFileSeparator) {