You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Koji Sekiguchi <ko...@r.email.ne.jp> on 2011/01/28 01:13:27 UTC

Re: svn commit: r1064330 - in /lucene/dev/trunk/solr: CHANGES.txt src/java/org/apache/solr/response/RawResponseWriter.java

I've changed SOLR-1283 to SOLR-2263 in svn:log by doing this:

svn propset --revprop -r 1064330 svn:log "SOLR-2263: Add ability for RawResponseWriter to stream 
binary files"

After that, I expected that I could see committed links under "Subversion Commits"
tab in JIRA move right places, but still SOLR-1283 ticket has the links. :(


(11/01/28 7:00), yonik@apache.org wrote:
> Author: yonik
> Date: Thu Jan 27 22:00:14 2011
> New Revision: 1064330
>
> URL: http://svn.apache.org/viewvc?rev=1064330&view=rev
> Log:
> SOLR-1283: Add ability for RawResponseWriter to stream binary files
>
> Modified:
>      lucene/dev/trunk/solr/CHANGES.txt
>      lucene/dev/trunk/solr/src/java/org/apache/solr/response/RawResponseWriter.java
>
> Modified: lucene/dev/trunk/solr/CHANGES.txt
> URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1064330&r1=1064329&r2=1064330&view=diff
> ==============================================================================
> --- lucene/dev/trunk/solr/CHANGES.txt (original)
> +++ lucene/dev/trunk/solr/CHANGES.txt Thu Jan 27 22:00:14 2011
> @@ -419,6 +419,9 @@ New Features
>   * SOLR-2129: Added a Solr module for dynamic metadata extraction/indexing with Apache UIMA.
>     See contrib/uima/README.txt for more information.  (Tommaso Teofili via rmuir)
>
> +* SOLR-1283: Add ability for RawResponseWriter to stream binary files as well as
> +  text files.  (Eric Pugh via yonik)
> +
>   Optimizations
>   ----------------------
>
>
> Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/response/RawResponseWriter.java
> URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/response/RawResponseWriter.java?rev=1064330&r1=1064329&r2=1064330&view=diff
> ==============================================================================
> --- lucene/dev/trunk/solr/src/java/org/apache/solr/response/RawResponseWriter.java (original)
> +++ lucene/dev/trunk/solr/src/java/org/apache/solr/response/RawResponseWriter.java Thu Jan 27 22:00:14 2011
> @@ -18,6 +18,7 @@
>   package org.apache.solr.response;
>
>   import java.io.IOException;
> +import java.io.OutputStream;
>   import java.io.Reader;
>   import java.io.Writer;
>
> @@ -44,7 +45,7 @@ import org.apache.solr.request.SolrQuery
>    * @version $Id$
>    * @since solr 1.3
>    */
> -public class RawResponseWriter implements QueryResponseWriter
> +public class RawResponseWriter implements BinaryQueryResponseWriter
>   {
>     /**
>      * The key that should be used to add a ContentStream to the
> @@ -93,4 +94,24 @@ public class RawResponseWriter implement
>         getBaseWriter( request ).write( writer, request, response );
>       }
>     }
> +
> +public void write(OutputStream out, SolrQueryRequest request,
> +		SolrQueryResponse response) throws IOException {
> +    Object obj = response.getValues().get( CONTENT );
> +    if( obj != null&&  (obj instanceof ContentStream ) ) {
> +      // copy the contents to the writer...
> +      ContentStream content = (ContentStream)obj;
> +      java.io.InputStream in = content.getStream();
> +      try {
> +        IOUtils.copy( in, out );
> +      } finally {
> +        in.close();
> +      }
> +    }
> +    else {
> +      //getBaseWriter( request ).write( writer, request, response );
> +    	throw new IOException("did not find a CONTENT object");
> +    }
> +	
> +}
>   }
>
>
>


-- 
http://www.rondhuit.com/en/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org