Lines Matching defs:extension
38 * Returns the file extension or an empty string iff there is no
39 * extension. This method is a convenience method for obtaining the
40 * extension of a url and has undefined results for other Strings.
42 * @return The file extension of the given url.
84 * Return the MIME type for the given extension.
85 * @param extension A file extension without the leading '.'
86 * @return The MIME type for the given extension or null iff there is none.
88 public String getMimeTypeFromExtension(String extension) {
89 return MimeUtils.guessMimeTypeFromExtension(extension);
93 private static String mimeTypeFromExtension(String extension) {
94 return MimeUtils.guessMimeTypeFromExtension(extension);
98 * Return true if the given extension has a registered MIME type.
99 * @param extension A file extension without the leading '.'
100 * @return True iff there is an extension entry in the map.
102 public boolean hasExtension(String extension) {
103 return MimeUtils.hasExtension(extension);
107 * Return the registered extension for the given MIME type. Note that some
109 * common extension for the given MIME type.
111 * @return The extension for the given MIME type or null iff there is none.
130 // the right MIME type from the file extension (if any):
143 String extension = getFileExtensionFromUrl(url);
144 String newMimeType = getMimeTypeFromExtension(extension);