staticweb directory type

asked 2016-04-20 15:56:14 -0500

ganges gravatar image

I am trying to create a static website using openstack swift. I would like to understand the X-Container-Meta-Web-Directory-Type on container.

I have followed below steps:

  1. Created a container with metadata X-Container-Meta-Web-Listing & X-Container-Meta-Web-Directory-Type: application/directory.
  2. Create a directory using curl command: curl -v -H 'X-Auth-Token:xxxxx' http://x.x.x.x:8080/v1/AUTH_4c54cc1577ab448396b3c488343d472f/gc3/ (http://x.x.x.x:8080/v1/AUTH_4c54cc157...)dir1 -H 'Content-Length: 0' -H 'Content-Type: application/directory' -X PUT

When i access the container using public_url, i am able to see the directory listing, upon clicking the dir1, I am getting inside (browsing) the directory.

If i don't set the 'Content-Type: application/directory' on the directory, i am not able to browse through the directory instead it is getting downloaded as an object.

I looked at the staticweb documentation, it says

The content-type of directory marker objects can be modified by setting the X-Container-Meta-Web-Directory-Type header. If the header is not set, application/directory is used by default. Directory marker objects are 0-byte objects that represent directories to create a simulated hierarchical structure.

but doesn't give clear picture on how this will be used. An example would be good to understand.

So, Kindly let me know whether my observation is correct or not.

Also, What are the other directory types which i can pass for "X-Container-Meta-Web-Directory-Type" and supported by openstack?

Thank you in advance.

Best Regards, Ganges

edit retag flag offensive close merge delete