首页 > 解决方案 > 即使凭证文件存在,AWS SDK 也会显示“配置文件不存在”

问题描述

如果credential_path"Profile file '$credential_path' does not exist"包含任何隐藏文件夹(如"c:\\\\User\\\\.aws\\\\credentials".

如何让它发挥作用?

AWS SDK 检查文件是否存在

"Validate.validState(contentLocation.toFile().exists(), "Profile file '%s' does not exist.", contentLocation);"

可以java.nio.file使用隐藏文件夹吗?

我使用 aws sdk 的测试代码:

ProfileFile profile = ProfileFile.builder()                                          
        .content(Paths.get("C:\\Users\\XXX\\.aws\\credentials"))                                         
        .type(ProfileFile.Type.CREDENTIALS)
        .build();

标签: amazon-web-servicesjava.nio.file

解决方案


推荐阅读