You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oodt.apache.org by ri...@apache.org on 2012/02/21 06:04:08 UTC
svn commit: r1291595 -
/oodt/trunk/grid/src/main/java/org/apache/oodt/grid/ProductQueryServlet.java
Author: rickdn
Date: Tue Feb 21 05:04:08 2012
New Revision: 1291595
URL: http://svn.apache.org/viewvc?rev=1291595&view=rev
Log:
rollback unnecessary changes to ProductQueryServlet (caused by eclipse auto save actions).
see diff with r1291586
Modified:
oodt/trunk/grid/src/main/java/org/apache/oodt/grid/ProductQueryServlet.java
Modified: oodt/trunk/grid/src/main/java/org/apache/oodt/grid/ProductQueryServlet.java
URL: http://svn.apache.org/viewvc/oodt/trunk/grid/src/main/java/org/apache/oodt/grid/ProductQueryServlet.java?rev=1291595&r1=1291594&r2=1291595&view=diff
==============================================================================
--- oodt/trunk/grid/src/main/java/org/apache/oodt/grid/ProductQueryServlet.java (original)
+++ oodt/trunk/grid/src/main/java/org/apache/oodt/grid/ProductQueryServlet.java Tue Feb 21 05:04:08 2012
@@ -17,40 +17,36 @@
package org.apache.oodt.grid;
-import org.apache.oodt.product.LargeProductQueryHandler;
-import org.apache.oodt.product.ProductException;
-import org.apache.oodt.product.QueryHandler;
-import org.apache.oodt.product.Retriever;
-import org.apache.oodt.xmlquery.LargeResult;
-import org.apache.oodt.xmlquery.Result;
-import org.apache.oodt.xmlquery.XMLQuery;
-
import java.io.BufferedInputStream;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
-
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.apache.oodt.product.LargeProductQueryHandler;
+import org.apache.oodt.product.ProductException;
+import org.apache.oodt.product.QueryHandler;
+import org.apache.oodt.product.Retriever;
+import org.apache.oodt.xmlquery.LargeResult;
+import org.apache.oodt.xmlquery.Result;
+import org.apache.oodt.xmlquery.XMLQuery;
/**
* Product query servlet handles product queries. It always returns the first matching
* product, if any. If no handler can provide a product, it returns 404 Not Found. If
* there are no query handlers, it returns 404 Not Found.
- *
+ *
*/
public class ProductQueryServlet extends QueryServlet {
/** {@inheritDoc} */
- @Override
- protected List getServers(Configuration config) {
+ protected List getServers(Configuration config) {
return config.getProductServers();
}
/** {@inheritDoc} */
- @Override
- protected void handleQuery(XMLQuery query, List handlers, HttpServletRequest req, HttpServletResponse res)
+ protected void handleQuery(XMLQuery query, List handlers, HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
if (handlers.isEmpty()) {
res.sendError(HttpServletResponse.SC_NOT_FOUND, "no query handlers available to handle query");
@@ -98,7 +94,7 @@ public class ProductQueryServlet extends
int num; // And a place to count data
while ((num = in.read(buf)) != -1) // While we read
res.getOutputStream().write(buf, 0, num); // We write
- res.getOutputStream().flush();
+ res.getOutputStream().flush(); // Flush to commit response
} finally { // And finally
if (in != null) try { // If we opened it
in.close(); // Close it
@@ -117,7 +113,7 @@ public class ProductQueryServlet extends
res.setContentType(contentType); // Set it
long size = result.getSize(); // Grab the size
if (size >= 0)
- res.addHeader("Content-Length", String.valueOf(size)); // Don't use setContentLength(int)
+ res.addHeader("Content-Length", String.valueOf(size)); // Don't use setContentLength(int)
if (!displayable(contentType)) // Finally, if a browser can't show it
suggestFilename(result.getResourceID(), res); // Then suggest a save-as filename
}
@@ -184,7 +180,7 @@ public class ProductQueryServlet extends
}
/** Handler to use. */
- private final LargeProductQueryHandler handler;
+ private LargeProductQueryHandler handler;
}
}