11a37d047SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
31a37d047SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
41a37d047SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
51a37d047SAndrew Rist  * distributed with this work for additional information
61a37d047SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
71a37d047SAndrew Rist  * to you under the Apache License, Version 2.0 (the
81a37d047SAndrew Rist  * "License"); you may not use this file except in compliance
91a37d047SAndrew Rist  * with the License.  You may obtain a copy of the License at
101a37d047SAndrew Rist  *
111a37d047SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
121a37d047SAndrew Rist  *
131a37d047SAndrew Rist  * Unless required by applicable law or agreed to in writing,
141a37d047SAndrew Rist  * software distributed under the License is distributed on an
151a37d047SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
161a37d047SAndrew Rist  * KIND, either express or implied.  See the License for the
171a37d047SAndrew Rist  * specific language governing permissions and limitations
181a37d047SAndrew Rist  * under the License.
191a37d047SAndrew Rist  *
201a37d047SAndrew Rist  *************************************************************/
211a37d047SAndrew Rist 
221a37d047SAndrew Rist 
23cdf0e10cSrcweir package com.sun.star.report;
24cdf0e10cSrcweir 
25cdf0e10cSrcweir import java.io.IOException;
26cdf0e10cSrcweir import java.io.OutputStream;
27cdf0e10cSrcweir 
28cdf0e10cSrcweir /**
29cdf0e10cSrcweir  * A repository for writing. Providing a repository always assumes,
30cdf0e10cSrcweir  * that more than one stream can be written.
31cdf0e10cSrcweir  *
32cdf0e10cSrcweir  * @author Thomas Morgner
33cdf0e10cSrcweir  */
34cdf0e10cSrcweir public interface OutputRepository
35cdf0e10cSrcweir {
36cdf0e10cSrcweir 
37cdf0e10cSrcweir     /**
38cdf0e10cSrcweir      * Creates an output stream for writing the data. If there is an entry with
39cdf0e10cSrcweir      * that name already contained in the repository, try to overwrite it.
40cdf0e10cSrcweir      *
41cdf0e10cSrcweir      * @param name
42cdf0e10cSrcweir      *    the name of the output stream
43cdf0e10cSrcweir      * @param mimeType
44cdf0e10cSrcweir      *    the mime type of the to-be-created output stream. Repository implementations which do not support
45cdf0e10cSrcweir      *    associating a mime time with a stream might ignore this parameter.
46cdf0e10cSrcweir      * @return the outputstream
47cdf0e10cSrcweir      * @throws IOException if opening the stream fails
48cdf0e10cSrcweir      */
createOutputStream(final String name, final String mimeType)49cdf0e10cSrcweir     OutputStream createOutputStream(final String name, final String mimeType) throws IOException;
50cdf0e10cSrcweir 
51*30acf5e8Spfg     /** allows to access sub repositories inside this repository
52cdf0e10cSrcweir      *
53cdf0e10cSrcweir      * @param name describes the path to the sub repository
54cdf0e10cSrcweir      * @param mimeType
55cdf0e10cSrcweir      * @return the sub repository
56cdf0e10cSrcweir      * @throws java.io.IOException when the sub repository doesn't exist.
57cdf0e10cSrcweir      */
openOutputRepository(final String name, final String mimeType)58cdf0e10cSrcweir     OutputRepository openOutputRepository(final String name, final String mimeType) throws IOException;
59cdf0e10cSrcweir 
exists(final String name)60cdf0e10cSrcweir     boolean exists(final String name);
61cdf0e10cSrcweir 
existsStorage(final String name)62cdf0e10cSrcweir     boolean existsStorage(final String name);
63cdf0e10cSrcweir 
isWritable(final String name)64cdf0e10cSrcweir     boolean isWritable(final String name);
65cdf0e10cSrcweir 
closeOutputRepository()66cdf0e10cSrcweir     void closeOutputRepository();
67cdf0e10cSrcweir }
68