ContentStreamBase content = new ContentStreamBase.FileStream( adminFile ); content.setContentType( req.getParams().get( USE_CONTENT_TYPE ) );
ContentStreamBase stream = new ContentStreamBase.FileStream( new File(file) ); if( contentType != null ) { stream.setContentType( contentType );
/** * Add a File to the {@link org.apache.solr.common.util.ContentStream}s. * @param file The File to add. * @throws IOException if there was an error with the file. * * @see #getContentStreams() * @see org.apache.solr.common.util.ContentStreamBase.FileStream */ public void addFile(File file, String contentType) throws IOException { ContentStreamBase cs = new ContentStreamBase.FileStream(file); cs.setContentType(contentType); addContentStream(cs); }
/** * Add a File to the {@link org.apache.solr.common.util.ContentStream}s. * @param file The File to add. * @throws IOException if there was an error with the file. * * @see #getContentStreams() * @see org.apache.solr.common.util.ContentStreamBase.FileStream */ public void addFile(File file, String contentType) throws IOException { ContentStreamBase cs = new ContentStreamBase.FileStream(file); cs.setContentType(contentType); addContentStream(cs); }
/** * Add a File to the {@link org.apache.solr.common.util.ContentStream}s. * @param file The File to add. * @throws IOException if there was an error with the file. * * @see #getContentStreams() * @see org.apache.solr.common.util.ContentStreamBase.FileStream */ public void addFile(File file) throws IOException { addContentStream(new ContentStreamBase.FileStream(file)); }