This should read "MimeTypes are equal" not "equals"
/**
* MimeTypes are equals if their primary types, subtypes, and
* parameters are all equal. No default values are taken into
* account.
*/
public boolean equals(Object thatObject) {
At the bottom of the block of code below, "now" should be "no"
/**
* A routine for parsing the MIME type out of a String.
*/
private void parse(String rawdata) throws MimeTypeParseException {
//System.out.println("MimeType.parse("+rawdata+")");
int slashIndex = rawdata.indexOf('/');
int semIndex = rawdata.indexOf(';');
if((slashIndex < 0) && (semIndex < 0)) {
// neither character is present, so treat it
// as an error
throw new MimeTypeParseException("Unable to find a sub type.");
} else if((slashIndex < 0) && (semIndex >= 0)) {
// we have a ';' (and therefore a parameter list),
// but now '/' indicating a sub type is present
throw new MimeTypeParseException("Unable to find a sub type.");
Fix doc comments for the following two methods:
/**
* Determine of the primary and sub type of this object is
* the same as the what is in the given type.
*/
public boolean match(MimeType type) {
if (type == null)
return false;
return primaryType.equals(type.getPrimaryType())
&& (subType.equals("*")
|| type.getSubType().equals("*")
|| (subType.equals(type.getSubType())));
}
/**
* Determine of the primary and sub type of this object is
* the same as the content type described in rawdata.
*/
public boolean match(String rawdata) throws MimeTypeParseException {
if (rawdata == null)
return false;
return match(new MimeType(rawdata));
}
/**
* MimeTypes are equals if their primary types, subtypes, and
* parameters are all equal. No default values are taken into
* account.
*/
public boolean equals(Object thatObject) {
At the bottom of the block of code below, "now" should be "no"
/**
* A routine for parsing the MIME type out of a String.
*/
private void parse(String rawdata) throws MimeTypeParseException {
//System.out.println("MimeType.parse("+rawdata+")");
int slashIndex = rawdata.indexOf('/');
int semIndex = rawdata.indexOf(';');
if((slashIndex < 0) && (semIndex < 0)) {
// neither character is present, so treat it
// as an error
throw new MimeTypeParseException("Unable to find a sub type.");
} else if((slashIndex < 0) && (semIndex >= 0)) {
// we have a ';' (and therefore a parameter list),
// but now '/' indicating a sub type is present
throw new MimeTypeParseException("Unable to find a sub type.");
Fix doc comments for the following two methods:
/**
* Determine of the primary and sub type of this object is
* the same as the what is in the given type.
*/
public boolean match(MimeType type) {
if (type == null)
return false;
return primaryType.equals(type.getPrimaryType())
&& (subType.equals("*")
|| type.getSubType().equals("*")
|| (subType.equals(type.getSubType())));
}
/**
* Determine of the primary and sub type of this object is
* the same as the content type described in rawdata.
*/
public boolean match(String rawdata) throws MimeTypeParseException {
if (rawdata == null)
return false;
return match(new MimeType(rawdata));
}