cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gkossakow...@apache.org
Subject svn commit: r539010 - /cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSource.java
Date Thu, 17 May 2007 16:55:35 GMT
Author: gkossakowski
Date: Thu May 17 09:55:34 2007
New Revision: 539010

URL: http://svn.apache.org/viewvc?view=rev&rev=539010
Log:
Implementing handling of content (mime) type.

Modified:
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSource.java

Modified: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSource.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSource.java?view=diff&rev=539010&r1=539009&r2=539010
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSource.java
(original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSource.java
Thu May 17 09:55:34 2007
@@ -120,6 +120,22 @@
 			return 0;
 		}
 	}
+	
+    /**
+     * The mime-type of the content described by this object.
+     * If the source is not able to determine the mime-type by itself
+     * this can be null.
+     */
+    public String getMimeType() {
+    	try {
+			connect();
+			return servletConnection.getContentType();
+		} catch (Exception e) {
+			if (logger.isDebugEnabled())
+				logger.debug("Exception occured while making servlet request", e);
+			return null;
+		}
+    }
 
 	/**
 	 * Returns true always.



Mime
View raw message