You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ni...@apache.org on 2011/11/21 13:17:49 UTC
svn commit: r1204464 -
/tika/trunk/tika-core/src/main/java/org/apache/tika/mime/MediaType.java
Author: nick
Date: Mon Nov 21 12:17:48 2011
New Revision: 1204464
URL: http://svn.apache.org/viewvc?rev=1204464&view=rev
Log:
Add basic JavaDoc for a few MediaType methods that lacked it
Modified:
tika/trunk/tika-core/src/main/java/org/apache/tika/mime/MediaType.java
Modified: tika/trunk/tika-core/src/main/java/org/apache/tika/mime/MediaType.java
URL: http://svn.apache.org/viewvc/tika/trunk/tika-core/src/main/java/org/apache/tika/mime/MediaType.java?rev=1204464&r1=1204463&r2=1204464&view=diff
==============================================================================
--- tika/trunk/tika-core/src/main/java/org/apache/tika/mime/MediaType.java (original)
+++ tika/trunk/tika-core/src/main/java/org/apache/tika/mime/MediaType.java Mon Nov 21 12:17:48 2011
@@ -288,6 +288,11 @@ public final class MediaType implements
union(type.parameters, parameters));
}
+ /**
+ * Returns the base form of the MediaType, excluding
+ * any parameters, such as "text/plain" for
+ * "text/plain; charset=utf-8"
+ */
public MediaType getBaseType() {
if (parameters.isEmpty()) {
return this;
@@ -296,10 +301,18 @@ public final class MediaType implements
}
}
+ /**
+ * Return the Type of the MediaType, such as
+ * "text" for "text/plain"
+ */
public String getType() {
return string.substring(0, slash);
}
+ /**
+ * Return the Sub-Type of the MediaType,
+ * such as "plain" for "text/plain"
+ */
public String getSubtype() {
return string.substring(slash + 1, semicolon);
}