org.gcube.datatransformation.datatransformationlibrary.utils
Class MimeUtils

java.lang.Object
  extended by org.gcube.datatransformation.datatransformationlibrary.utils.MimeUtils

public class MimeUtils
extends Object

Author:
Dimitris Katris, NKUA

Helper class for mapping file extensions to mimetypes and mimetypes to file extensions.

The file which contains the mappings should be set in the utils.mime_mappings_file property.


Constructor Summary
MimeUtils()
           
 
Method Summary
static String getFileExtension(String mimeType)
          Returns the file extension of a mimetype.
static String getMimeType(String extension)
          Returns a mimetype of a file extension.
static void main(String[] args)
          Simple test.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MimeUtils

public MimeUtils()
Method Detail

main

public static void main(String[] args)
Simple test.

Parameters:
args - nothing.

getFileExtension

public static String getFileExtension(String mimeType)
Returns the file extension of a mimetype.

Parameters:
mimeType - The mimetype whose extension will be returned.
Returns:
The file extension.

getMimeType

public static String getMimeType(String extension)
Returns a mimetype of a file extension.

Parameters:
extension - The file extension whose mimetype will be returned.
Returns:
The mimetype.


Copyright © 2013. All Rights Reserved.