// Path: kbox.core/src/main/java/org/aksw/kbox/utils/GzipUtils.java
// public class GzipUtils {
// 
//     public static void pack(File input, File output) throws IOException {
//         try (GzipCompressorOutputStream out = new GzipCompressorOutputStream(new FileOutputStream(output))){
//             IOUtils.copy(new FileInputStream(input), out);
//         }
//     }
//     
//     public static void pack(InputStream input, File output) throws IOException {
//         try (GzipCompressorOutputStream out = new GzipCompressorOutputStream(new FileOutputStream(output))){
//             IOUtils.copy(input, out);
//         }
//     }
// 
//     public static void unpack(InputStream input, File output) throws IOException {
//         try (GzipCompressorInputStream in = new GzipCompressorInputStream(input)){
//         	try(FileOutputStream out = new FileOutputStream(output)){
//         		IOUtils.copy(in, out);
//         	}
//         }
//     }
// }


import java.io.File;
import java.io.InputStream;
import java.net.URL;
import org.aksw.kbox.utils.GzipUtils;
package org.aksw.kbox;



/**
 * Default install implementation for Gzip compressed files.
 * 
 * @author {@linkplain http://emarx.org}
 *
 */
public class GzipInstall extends ResourceInstall {
	
	@Override
	public void install(InputStream resource, URL target) throws Exception {
		File destPath = new File(urlToAbsolutePath(target));
		destPath.mkdirs();
// Path: kbox.core/src/main/java/org/aksw/kbox/utils/GzipUtils.java
// public class GzipUtils {
// 
//     public static void pack(File input, File output) throws IOException {
//         try (GzipCompressorOutputStream out = new GzipCompressorOutputStream(new FileOutputStream(output))){
//             IOUtils.copy(new FileInputStream(input), out);
//         }
//     }
//     
//     public static void pack(InputStream input, File output) throws IOException {
//         try (GzipCompressorOutputStream out = new GzipCompressorOutputStream(new FileOutputStream(output))){
//             IOUtils.copy(input, out);
//         }
//     }
// 
//     public static void unpack(InputStream input, File output) throws IOException {
//         try (GzipCompressorInputStream in = new GzipCompressorInputStream(input)){
//         	try(FileOutputStream out = new FileOutputStream(output)){
//         		IOUtils.copy(in, out);
//         	}
//         }
//     }
// }


// Path: kbox.core/src/main/java/org/aksw/kbox/GzipInstall.java
import java.io.File;
import java.io.InputStream;
import java.net.URL;
import org.aksw.kbox.utils.GzipUtils;

package org.aksw.kbox;



/**
 * Default install implementation for Gzip compressed files.
 * 
 * @author {@linkplain http://emarx.org}
 *
 */
public class GzipInstall extends ResourceInstall {
	
	@Override
	public void install(InputStream resource, URL target) throws Exception {
		File destPath = new File(urlToAbsolutePath(target));
		destPath.mkdirs();
		GzipUtils.unpack(resource, destPath);