Skip to content

Commit 34bcd7d

Browse files
garyrussellartembilan
authored andcommitted
Synchronize RemoteFileUtils.makeDirectories()
https://stackoverflow.com/questions/55918648 Avoid the race with concurrent threads. **cherry-pick to 5.x.x, 4.3.x** (cherry picked from commit 130e1bb)
1 parent 05a50fe commit 34bcd7d

File tree

1 file changed

+5
-3
lines changed
  • spring-integration-file/src/main/java/org/springframework/integration/file/remote

1 file changed

+5
-3
lines changed

spring-integration-file/src/main/java/org/springframework/integration/file/remote/RemoteFileUtils.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
*/
3333
public final class RemoteFileUtils {
3434

35-
private RemoteFileUtils() { }
35+
private RemoteFileUtils() {
36+
super();
37+
}
3638

3739
/**
3840
* Recursively create remote directories.
@@ -43,8 +45,8 @@ private RemoteFileUtils() { }
4345
* @param logger The logger.
4446
* @throws IOException Any IOException.
4547
*/
46-
public static <F> void makeDirectories(String path, Session<F> session, String remoteFileSeparator, Log logger)
47-
throws IOException {
48+
public static synchronized <F> void makeDirectories(String path, Session<F> session, String remoteFileSeparator,
49+
Log logger) throws IOException {
4850

4951
if (!session.exists(path)) {
5052

0 commit comments

Comments
 (0)