01: /*
02: * Copyright 2004 Outerthought bvba and Schaubroeck nv
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.outerj.daisy.tools.importexport.export.fs;
17:
18: import org.outerj.daisy.tools.importexport.ImportExportException;
19:
20: import java.io.OutputStream;
21: import java.io.FileNotFoundException;
22: import java.io.InputStream;
23: import java.io.IOException;
24:
25: /**
26: * The target to where export data is written
27: */
28: public interface ExportFile {
29: /**
30: * Gets an output stream for the specified path.
31: * The path might contain directories which do
32: * not yet exist in the export, in which case
33: * they should be auto-created.
34: */
35: OutputStream getOutputStream(String path)
36: throws ImportExportException, FileNotFoundException;
37:
38: /**
39: * Similar to {@link #getOutputStream(String)}.
40: */
41: void store(String path, InputStream is)
42: throws ImportExportException, IOException;
43:
44: /**
45: * Called when everything is written to the export file.
46: * After this method is called, {@link #getOutputStream} should
47: * not be called anymore.
48: */
49: void finish() throws ImportExportException;
50: }
|