[
https://issues.apache.org/jira/browse/HADOOP-11621?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14351989#comment-14351989
]
Denis Jannot commented on HADOOP-11621:
---------------------------------------
Sorry for the delay.
In fact, the S3 API doesn't have any notion of directory, so each third-party
software has it's own way of implementing a directory structure.
Most of them are creating keys like /dir1/ without any value and then when you
upload a file in this directory, it creates a /dir1/file1 key with the value
being the content of the file.
But, in any case, the content-length shouldn't be used by s3a to consider if
it's a directory or not.
Any key finishing by / (%2F) should be considered as a directory.
In fact, you only have to do this if you want to display empty directories,
because for any directory containing files, you will always have a key like
/dir1/file1 and you can use delimiter and prefix to determine the directory
structure to display.
Does it make sense ?
> s3a doesn't consider blobs with trailing / and content-length >0 as
> directories
> -------------------------------------------------------------------------------
>
> Key: HADOOP-11621
> URL: https://issues.apache.org/jira/browse/HADOOP-11621
> Project: Hadoop Common
> Issue Type: Bug
> Components: fs/s3
> Affects Versions: 2.7.0
> Reporter: Denis Jannot
>
> When creating a directory using the AWS Management Console, the
> content-length is set to 0 and s3a works fine.
> When creating a directory using other tools, like S3Browse, the
> content-length is set to 1 and s3a doesn't work:
> S3AFileSystem: Found file (with /): real file? should not happen: dir1
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)