Index: MimeType.java
===================================================================
--- MimeType.java	(revision 168975)
+++ MimeType.java	(working copy)
@@ -30,6 +30,9 @@
     /** The primary and sub types separator */
     private final static String SEPARATOR = "/";
     
+    /** The parameters separator */
+    private final static String PARAMS_SEP = ";";
+    
     /** Special characters not allowed in content types. */
     private final static String SPECIALS = "()<>@,;:\\\"/[]?=";
     
@@ -65,18 +68,14 @@
         if (name == null || name.length() <= 0) {
             throw new MimeTypeException("The type can not be null or empty");
         }
-
+        
         // Split the two parts of the Mime Content Type
         String[] parts = name.split(SEPARATOR, 2);
         
         // Checks validity of the parts
-        if ((parts.length != 2) || (!isValid(parts[0]))) {
-            throw new MimeTypeException("Invalid Primary Type " + parts[0]);
+        if (parts.length != 2) {
+            throw new MimeTypeException("Invalid Content Type " + name);
         }
-        if (!isValid(parts[1])) {
-            throw new MimeTypeException("Invalid Sub Type " + parts[1]);
-        }
-        // All is ok, init values
         init(parts[0], parts[1]);
      }    
     
@@ -86,23 +85,29 @@
      * @param sub the content type sub type.
      */
     public MimeType(String primary, String sub) throws MimeTypeException {
+        init(primary, sub);
+    }
+    
+    /** Init method used by constructors. */
+    private void init(String primary, String sub) throws MimeTypeException {
+
         // Preliminary checks...
         if ((primary == null) || (primary.length() <= 0) || (!isValid(primary))) {
             throw new MimeTypeException("Invalid Primary Type " + primary);
         }
-        if ((sub == null) || (sub.length() <= 0) || (!isValid(sub))) {
-            throw new MimeTypeException("Invalid Sub Type " + sub);
+        // Remove optional parameters from the sub type
+        String clearedSub = null;
+        if (sub != null) {
+            clearedSub = sub.split(PARAMS_SEP)[0];
         }
-        // All is ok, init values
-        init(primary, sub);
-    }
-
-    /** Init method used by constructors. */
-    private void init(String primary, String sub) {
+        if ((clearedSub == null) || (clearedSub.length() <= 0) || (!isValid(clearedSub))) {
+            throw new MimeTypeException("Invalid Sub Type " + clearedSub);
+        }
+                
         // All is ok, assign values
         this.name = primary + SEPARATOR + sub;
         this.primary = primary;
-        this.sub = sub;
+        this.sub = clearedSub;
         this.extensions = new ArrayList();
         this.magics = new ArrayList();
     }
Index: TestMimeType.java
===================================================================
--- TestMimeType.java	(revision 168975)
+++ TestMimeType.java	(working copy)
@@ -43,6 +43,7 @@
 
     /** Test of <code>MimeType(String)</code> constructor. */
     public void testConstructorString() {
+        MimeType type = null;
         constructorFailure(null);
         constructorFailure("");
         constructorFailure("mimetype");
@@ -50,19 +51,27 @@
         constructorFailure("/mimetype");
         constructorFailure("mime@type");
         constructorFailure("mime;type");
-        constructorSuccess("mime/type");
+        type = constructorSuccess("mime/type");
+        assertEquals("mime", type.getPrimaryType());
+        assertEquals("type", type.getSubType());
+        type = constructorSuccess("mime/type;parameter=value");
+        assertEquals("mime", type.getPrimaryType());
+        assertEquals("type", type.getSubType());
     }
 
     /** Test of <code>MimeType(String, String)</code> constructor. */
     public void testConstructorStringString() {
-        constructorFailure(null);
-        constructorFailure("");
-        constructorFailure("mimetype");
-        constructorFailure("mime/type/");
-        constructorFailure("/mimetype");
-        constructorFailure("mime@type");
-        constructorFailure("mime;type");
-        constructorSuccess("mime/type");
+        MimeType type = null;
+        constructorFailure(null, null);
+        constructorFailure("", "");
+        constructorFailure("mime", "type/");
+        constructorFailure("", "mimetype");
+        type = constructorSuccess("mime", "type");
+        assertEquals("mime", type.getPrimaryType());
+        assertEquals("type", type.getSubType());
+        type = constructorSuccess("mime", "type;parameter=value");
+        assertEquals("mime", type.getPrimaryType());
+        assertEquals("type", type.getSubType());
     }
     
     /** Test of <code>getName</code> method. */
