| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| IJTFileWriter |
|
| 1.0;1 |
| 1 | package org.jtheque.core.utils.file.jt.able; | |
| 2 | ||
| 3 | /* | |
| 4 | * This file is part of JTheque. | |
| 5 | * | |
| 6 | * JTheque is free software: you can redistribute it and/or modify | |
| 7 | * it under the terms of the GNU General Public License as published by | |
| 8 | * the Free Software Foundation, either version 3 of the License. | |
| 9 | * | |
| 10 | * JTheque is distributed in the hope that it will be useful, | |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 13 | * GNU General Public License for more details. | |
| 14 | * | |
| 15 | * You should have received a copy of the GNU General Public License | |
| 16 | * along with JTheque. If not, see <http://www.gnu.org/licenses/>. | |
| 17 | */ | |
| 18 | ||
| 19 | import org.jtheque.core.managers.file.able.BasicDataSource; | |
| 20 | import org.jtheque.utils.io.FileException; | |
| 21 | ||
| 22 | import java.io.BufferedOutputStream; | |
| 23 | import java.io.File; | |
| 24 | import java.io.FileOutputStream; | |
| 25 | ||
| 26 | /** | |
| 27 | * A file writer for JTheque File. | |
| 28 | * | |
| 29 | * @author Baptiste Wicht | |
| 30 | */ | |
| 31 | public interface IJTFileWriter { | |
| 32 | /** | |
| 33 | * Write a JT file to a File object. | |
| 34 | * | |
| 35 | * @param file The file to write to. | |
| 36 | * @param source The datasource. | |
| 37 | * @throws FileException Throws when an error occurs during the writing process. | |
| 38 | */ | |
| 39 | void writeFile(File file, BasicDataSource source) throws FileException; | |
| 40 | ||
| 41 | /** | |
| 42 | * Write a JT file to a file path. | |
| 43 | * | |
| 44 | * @param path The path of the file to write to. | |
| 45 | * @param source The datasource. | |
| 46 | * @throws FileException Throws when an error occurs during the writing process. | |
| 47 | */ | |
| 48 | void writeFile(String path, BasicDataSource source) throws FileException; | |
| 49 | ||
| 50 | /** | |
| 51 | * Write a JT file to a stream. | |
| 52 | * | |
| 53 | * @param stream The stream to write to. | |
| 54 | * @param source The datasource. | |
| 55 | * @throws FileException Throws when an error occurs during the writing process. | |
| 56 | */ | |
| 57 | void writeFile(FileOutputStream stream, BasicDataSource source) throws FileException; | |
| 58 | ||
| 59 | /** | |
| 60 | * Write a JT file to a stream. | |
| 61 | * | |
| 62 | * @param stream The stream to write to. | |
| 63 | * @param source The datasource. | |
| 64 | * @throws FileException Throws when an error occurs during the writing process. | |
| 65 | */ | |
| 66 | void writeFile(BufferedOutputStream stream, BasicDataSource source) throws FileException; | |
| 67 | } |