Using aws s3 prefix and delimiter to differentiate between "folders" and "files" with a common prefix
<p>The question is a bit wordy, but it is exactly what I'm looking to do. 
The question is relative to an existing (currently open) question I have <a href="https://stackoverflow.com/questions/35163012/iam-group-policy-for-s3-bucket-">here</a>. I believe that understanding this concept is key to answering my existing question, but distinct enough to warrant a whole new one.  </p>

<p>given these keys in an s3 bucket named "my-permtest":  </p>

<pre><code>/1/  
/1/a  
/1/2/b  
/1/3/c  
</code></pre>

<p>How can I use prefix and delimiter correctly to get the objects that don't end in "/", (IE: "files").    </p>

<p>The ultimate goal is to apply this knowledge to an IAM group policy granting ListBucket and getObject on /1/a while denying getObject or ListBucket to /1/2/, 1/2/*, 1/3 and 1/3/*    </p>

<p>I'm effectively looking to mimic traditional file system permissions that let a user access all "files" in a "folder" but restrict access to "subfolders".  </p>

<p>Currently, I'm using s3api calls and different values of prefix and delimiter options to get a feel for usage of these things. I've been reading and practicing with these resources, but going is slow and assist would be greatly appreciated.  </p>