Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the MIME type for properties files?

What is the MIME type for properties file?

Here is a list of all the files with different extensions but here I could not see any MIME type for the properties file.

Mime Types

I have a properties file in my scripts folder and I am trying to read it in another scripts. When run as simple HTML file and a script file it works properly but when I put it in my web application which uses Spring MVC, its not able to read the properties file.

The error I get is

No media type found for ServletContext resource [Messages_en.properties] -returning 404.

Please help.

like image 257
ashishjmeshram Avatar asked Jun 06 '11 05:06

ashishjmeshram


People also ask

What are MIME properties?

MIME properties are defined or arbitrary values that you can use to attach MIME document headers to documents within your integration process. For example, MIME properties can be set so that shapes like the HTTP Client connector can identify a MIME document as it passes through a process.

What are MIME types for files?

A MIME type consists of two parts: a type and a subtype. Currently, there are ten registered types: application, audio, example, font, image, message, model, multipart, text, and video.

How do I know my MIME type?

For detecting MIME-types, use the aptly named "mimetype" command. It has a number of options for formatting the output, it even has an option for backward compatibility to "file". But most of all, it accepts input not only as file, but also via stdin/pipe, so you can avoid temporary files when processing streams.

Do all files have MIME type?

There are too many issues with MIME types on different operating systems, different applications saving files differently, some files not having a MIME at all, and lastly, the fact that the extension and MIME could be altered by a malicious user or program.


3 Answers

Commonly used is text/x-java-properties. E.g. project MoinMoin uses that.

like image 160
Ondra Žižka Avatar answered Oct 06 '22 19:10

Ondra Žižka


According to Apache HTTPd's Mime type list which is probably the most extensive you can find, there is no definition for properties files.

It's not clear to me what you're trying to achieve, but generally text/plain works well with properties files.

like image 24
Nico Avatar answered Oct 06 '22 19:10

Nico


According to IANA Media Types which is the most authoritative source, there is no standard MIME type for Java Properties files.

Apache HTTPD / Subversion MIME type lists (which are referenced in other answers as the one from @nico) are simply a copy of IANA's.

RFC2046 specifies that Media Types (formerly known as MIME types) and Media Subtypes will be assigned and listed by the IANA. (Source IANA Media Types)

Anyway, I've to agree with @Ondra Žižka that a few non-authoritative - but relevant - sources (like Trac and CaCert.org, for instance) are seemingly converging onto the text/x-java-properties type, which is correctly using the `x-' prefix.

There is not a dozen places where this MIME type is used, though.

like image 9
Chucky Avatar answered Oct 06 '22 18:10

Chucky