--- /dev/null
+/**\r
+ * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.\r
+ *\r
+ * This library is free software; you can redistribute it and/or modify it under\r
+ * the terms of the GNU Lesser General Public License as published by the Free\r
+ * Software Foundation; either version 2.1 of the License, or (at your option)\r
+ * any later version.\r
+ *\r
+ * This library is distributed in the hope that it will be useful, but WITHOUT\r
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\r
+ * details.\r
+ */\r
+\r
+package com.liferay.portal.kernel.util;\r
+\r
+import java.io.File;\r
+\r
+import java.io.InputStream;\r
+\r
+/**\r
+ * @author Jorge Ferrer\r
+ * @author Brian Wing Shun Chan\r
+ * @author Alexander Chow\r
+ */\r
+public class MimeTypesOverrideUtil {\r
+\r
+ public static String getContentType(File file) {\r
+ return getService().getContentType(file);\r
+ }\r
+\r
+ /**\r
+ * Determine the content type from an input stream and file name.\r
+ *\r
+ * @param fileName full name or extension of file (e.g., "Test.doc",\r
+ * ".doc")\r
+ * @return content type if it is a supported format or an empty string if it\r
+ * is an unsupported format\r
+ */\r
+ public static String getContentType(\r
+ InputStream inputStream, String fileName) {\r
+\r
+ return getService().getContentType(inputStream, fileName);\r
+ }\r
+\r
+ /**\r
+ * Determine the content type from a file name.\r
+ *\r
+ * @param fileName full name or extension of file (e.g., "Test.doc",\r
+ * ".doc")\r
+ * @return content type if it is a supported format or an empty string if it\r
+ * is an unsupported format\r
+ */\r
+ public static String getContentType(String fileName) {\r
+ return getService().getContentType(fileName);\r
+ }\r
+\r
+ public static MimeTypesOverride getService() {\r
+ return _service;\r
+ }\r
+\r
+ public void setService(MimeTypesOverride mimeTypes) {\r
+ _service = mimeTypes;\r
+ }\r
+\r
+ private static MimeTypesOverride _service;\r
+\r
+}
\ No newline at end of file