| 1 | |
package org.jtheque.core.utils.file.jt; |
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
|
| 19 | |
import org.jtheque.core.managers.file.able.BasicDataSource; |
| 20 | |
import org.jtheque.core.utils.file.jt.able.IJTFileWriter; |
| 21 | |
import org.jtheque.utils.io.FileException; |
| 22 | |
|
| 23 | |
import java.io.BufferedOutputStream; |
| 24 | |
import java.io.File; |
| 25 | |
import java.io.FileNotFoundException; |
| 26 | |
import java.io.FileOutputStream; |
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | |
|
| 32 | |
|
| 33 | 0 | public abstract class JTZippedFileWriter implements IJTFileWriter { |
| 34 | |
@Override |
| 35 | |
public final void writeFile(File file, BasicDataSource source) throws FileException { |
| 36 | |
try { |
| 37 | 0 | writeFile(new FileOutputStream(file), source); |
| 38 | 0 | } catch (FileNotFoundException e) { |
| 39 | 0 | throw new FileException("File not found", e); |
| 40 | 0 | } |
| 41 | 0 | } |
| 42 | |
|
| 43 | |
@Override |
| 44 | |
public final void writeFile(String path, BasicDataSource source) throws FileException { |
| 45 | 0 | writeFile(new File(path), source); |
| 46 | 0 | } |
| 47 | |
|
| 48 | |
@Override |
| 49 | |
public final void writeFile(FileOutputStream stream, BasicDataSource source) throws FileException { |
| 50 | 0 | writeFile(new BufferedOutputStream(stream), source); |
| 51 | 0 | } |
| 52 | |
} |