Coverage Report - org.jtheque.core.utils.file.jt.JTZippedFileWriter
 
Classes in this File Line Coverage Branch Coverage Complexity
JTZippedFileWriter
0 %
0/10
N/A
1.667
 
 1  
 package org.jtheque.core.utils.file.jt;
 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.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  
  * A writer for JT zipped file.
 30  
  *
 31  
  * @author Baptiste Wicht
 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  
 }