Tag: cws_src680_oj14 User: fs Date: 2007-06-20 19:10:40+0000 Modified: dba/reportdesign/java/com/sun/star/report/StorageRepository.java
Log: #i78373# createOutputStream: support for a mimetype File Changes: Directory: /dba/reportdesign/java/com/sun/star/report/ ====================================================== File [changed]: StorageRepository.java Url: http://dba.openoffice.org/source/browse/dba/reportdesign/java/com/sun/star/report/StorageRepository.java?r1=1.1.2.1&r2=1.1.2.2 Delta lines: +8 -4 ------------------- --- StorageRepository.java 2007-06-06 07:05:20+0000 1.1.2.1 +++ StorageRepository.java 2007-06-20 19:10:37+0000 1.1.2.2 @@ -4,9 +4,9 @@ * * $RCSfile: StorageRepository.java,v $ * - * $Revision: 1.1.2.1 $ + * $Revision: 1.1.2.2 $ * - * last change: $Author: oj $ $Date: 2007/06/06 07:05:20 $ + * last change: $Author: fs $ $Date: 2007/06/20 19:10:37 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -86,15 +86,19 @@ * that name already contained in the repository, try to overwrite it. * * @param name + * @param mimeType * @return the outputstream * @throws IOException if opening the stream fails */ - public OutputStream createOutputStream(String name) throws IOException { + public OutputStream createOutputStream(String name, String mimeType) throws IOException { try{ final XStream stream = (XStream) UnoRuntime.queryInterface(XStream.class,output.openStreamElement(name,ElementModes.WRITE|ElementModes.TRUNCATE)); stream.getInputStream().closeInput(); + if (mimeType != null) + { final XPropertySet prop = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,stream); - prop.setPropertyValue("MediaType","text/xml"); + prop.setPropertyValue("MediaType",mimeType); + } return new BufferedOutputStream(new XOutputStreamToOutputStreamAdapter(stream.getOutputStream()),204800); }catch(com.sun.star.uno.Exception e){ throw new IOException("createOutputStream"); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
