Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

Why this extra ".dir" folder gets created during vlt checkout for some jcr:mimeType (like text/javascript) ?

Avatar

Level 4

Hi all,

 

I noticed that for certain files a corresponding ".dir" folder gets created on your local laptop when you perform vault checkout from CRX. Does anyone know why this ".dir" folder is getting created ? It happens to files with certain "jcr:mimeType".

 

For example:

C:\rohit>  vlt co http://localhost:4502/crx/-/jcr:root/app/clientlib/js/validation.js  .

 

This will create extra "validation.js.dir" folder on your local

 

Found that if the "jcr:content" has jcr:mimeType of "text/javascript" instead of "application/javascript" then this ".dir" folder is created. Then read on google that "text/javascript" will become obsolete so we should be using "application/javascript" as mimeType

 

Now I tried checkout of another font file with ".ttf" extension (fontawesome-webfont.ttf) having "jcr:mimeType" of "application/x-font-ttf" (seem like mimeType is correctly detected in CRX). For this also a ".dir" folder got created. If I change the mimeType to application/o

 

Question is:

1) Why is this ".dir" folder getting created for specific mimeType ? Does this affect anything ?

2) For ".ttf" extension which mime type should i use ? On google i got mixed answered (both application/octet-stream & application/x-font-ttf)

http://stackoverflow.com/questions/12660389/what-is-the-correct-mime-type-for-a-font-file

 

Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Level 10
  1. if the mime-type of a resource does not match the extension or is not known then .dir is created
  2. I do not see mimetype defined for ttf [1]. please file support request to add missing mimetype ttf.

[1]  http://grepcode.com/file_/repo1.maven.org/maven2/org.apache.jackrabbit.vault/org.apache.jackrabbit.v...

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10
  1. if the mime-type of a resource does not match the extension or is not known then .dir is created
  2. I do not see mimetype defined for ttf [1]. please file support request to add missing mimetype ttf.

[1]  http://grepcode.com/file_/repo1.maven.org/maven2/org.apache.jackrabbit.vault/org.apache.jackrabbit.v...

Avatar

Level 4

Hi Sham,

Thanks for your quick reply.

For (2) - So when i uploaded the ".ttf" file via webdav howcome in CRX the mimeType was set to "application/x-font-ttf" . Yes i clearly see in the link which you have shared that ".ttf" is not present there.

 http://grepcode.com/file_/repo1.maven.org/maven2/org.apache.jackrabbit.vault/org.apache.jackrabbit.v...

static { // add some default mappings addMapping(false, "text/plain", "txt", "jsp", "jspx", "jspf", "ecma", "esp", "xsl", "xslt", "dtd", "properties", "tld" ,"php", "rb", "bnd"); addMapping(false, "text/cnd"  , "cnd"); addMapping(false, "text/x-java-source" , "java"); addMapping(true,  "application/java-vm" , "class"); addMapping(false, "text/html" , "html", "htm"); addMapping(false, "text/xml"  , "xml"); addMapping(false, "text/css"  , "css", "less"); addMapping(false, "text/calendar", "ics"); addMapping(false, "image/svg+xml", "svg"); addMapping(false, "application/xliff+xml"  , "xliff"); addMapping(true,  "image/gif" , "gif"); addMapping(true,  "image/png" , "png"); addMapping(true,  "image/jpeg", "jpg", "jpeg"); addMapping(true,  "image/jpg" , "jpg", "jpeg"); // this is for compatibility reasons addMapping(false, "application/json", "json"); addMapping(true,  "application/java-archive", "jar"); addMapping(false, "application/javascript", "js"); addMapping(false, "application/ecmascript", "ecma"); addMapping(false, "application/x-javascript", "js"); // discouraged per RFC-4329 addMapping(true,  "application/pdf", "pdf"); addMapping(true,  "application/x-shockwave-flash", "swf"); addMapping(true,  "application/zip", "zip"); addMapping(true,  "image/vnd.microsoft.icon", "ico"); addMapping(true,  "application/x-font-woff", "woff"); addMapping(true,  "application/vnd.ms-fontobject", "eot"); }