This is an automated email from the ASF dual-hosted git repository.

nacx pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jclouds.git


The following commit(s) were added to refs/heads/master by this push:
     new eb1181daf5 check file exists in getContainerAccess (#185)
eb1181daf5 is described below

commit eb1181daf5edb0307acaf029f7569bd21dcd3fe9
Author: jixinchi <[email protected]>
AuthorDate: Fri Oct 13 00:18:30 2023 +0800

    check file exists in getContainerAccess (#185)
---
 .../filesystem/strategy/internal/FilesystemStorageStrategyImpl.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/apis/filesystem/src/main/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImpl.java
 
b/apis/filesystem/src/main/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImpl.java
index 1a58fb59d1..79138f50bd 100644
--- 
a/apis/filesystem/src/main/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImpl.java
+++ 
b/apis/filesystem/src/main/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImpl.java
@@ -187,7 +187,11 @@ public class FilesystemStorageStrategyImpl implements 
LocalStorageStrategy {
 
    @Override
    public ContainerAccess getContainerAccess(String container) {
-      Path path = new File(buildPathStartingFromBaseDir(container)).toPath();
+      File file = new File(buildPathStartingFromBaseDir(container));
+      if (!file.exists()) {
+         throw new ContainerNotFoundException(container, "in 
getContainerAccess");
+      }
+      Path path = file.toPath();
 
       if ( isWindows() ) {
          try {

Reply via email to