whitespace fixed
[jSite.git] / src / de / todesbaum / util / mime / DefaultMIMETypes.java
index c821912..9e380a5 100644 (file)
@@ -1,4 +1,4 @@
-/* taken from freenet (http://www.freenetproject.org/) */ 
+/* taken from freenet (http://www.freenetproject.org/) */
 package de.todesbaum.util.mime;
 
 import java.util.HashMap;
@@ -10,23 +10,23 @@ import java.util.Vector;
  * Holds the default MIME types.
  */
 public class DefaultMIMETypes {
-       
+
        /** Default MIME type - what to set it to if we don't know any better */
        public static final String DEFAULT_MIME_TYPE = "application/octet-stream";
-       
+
        /** MIME types: number -> name */
        private static List<String> mimeTypesByNumber = new Vector<String>();
-       
+
        /** MIME types: name -> number */
        private static Map<String, Short> mimeTypesByName = new HashMap<String, Short>();
-       
+
        /** MIME types by extension. One extension maps to one MIME type, but not necessarily
         * the other way around. */
        private static Map<String, Short> mimeTypesByExtension = new HashMap<String, Short>();
-       
+
        /** Primary extension by MIME type number. */
        private static Map<Short, String> primaryExtensionByMimeNumber = new HashMap<Short, String>();
-       
+
        /**
         * Add a MIME type, without any extensions.
         * @param number The number of the MIME type for compression. This *must not change*
@@ -73,7 +73,7 @@ public class DefaultMIMETypes {
                }
                if(outExtension != null)
                        primaryExtensionByMimeNumber.put(t, outExtension);
-                               
+
        }
 
        /**
@@ -91,7 +91,7 @@ public class DefaultMIMETypes {
        protected static synchronized void addMIMEType(short number, String type, String extensions, String outExtension) {
                addMIMEType(number, type, extensions.split(" "), outExtension);
        }
-       
+
        /**
         * Get a known MIME type by number.
         */
@@ -100,7 +100,7 @@ public class DefaultMIMETypes {
                        return null;
                return mimeTypesByNumber.get(x);
        }
-       
+
        /**
         * Get the number of a MIME type, or -1 if it is not in the table of known MIME
         * types, in which case it will have to be sent uncompressed.
@@ -110,13 +110,13 @@ public class DefaultMIMETypes {
                if(x != null) return x.shortValue();
                return -1;
        }
-       
+
        /* From toad's /etc/mime.types
-        * cat /etc/mime.types | sed "/^$/d;/#/d" | tr --squeeze '\t' ' ' | 
-        * (y=0; while read x; do echo "$x" | 
+        * cat /etc/mime.types | sed "/^$/d;/#/d" | tr --squeeze '\t' ' ' |
+        * (y=0; while read x; do echo "$x" |
         * sed -n "s/^\([^ ]*\)$/addMIMEType\($y, \"\1\"\);/p;s/^\([^ (),]\+\) \(.*\)$/addMIMEType\($y, \"\1\", \"\2\"\);/p;"; y=$((y+1)); done)
         */
-       
+
        static {
                addMIMEType((short) 0, "application/activemessage");
                addMIMEType((short) 1, "application/andrew-inset", "ez");
@@ -807,7 +807,7 @@ public class DefaultMIMETypes {
                addMIMEType((short) 686, "x-conference/x-cooltalk", "ice");
                addMIMEType((short) 687, "x-world/x-vrml", "vrm vrml wrl");
        }
-       
+
        /** Guess a MIME type from a filename */
        public static String guessMIMEType(String arg) {
                int x = arg.lastIndexOf('.');
@@ -826,7 +826,7 @@ public class DefaultMIMETypes {
                if(typeNumber < 0) return null;
                return primaryExtensionByMimeNumber.get(typeNumber);
        }
-       
+
        public static String[] getAllMIMETypes() {
                return mimeTypesByNumber.toArray(new String[mimeTypesByNumber.size()]);
        }