1 16 package org.apache.commons.vfs.provider.gzip; 17 18 import org.apache.commons.vfs.FileName; 19 import org.apache.commons.vfs.FileObject; 20 import org.apache.commons.vfs.provider.compressed.CompressedFileFileObject; 21 import org.apache.commons.vfs.provider.compressed.CompressedFileFileSystem; 22 23 import java.io.InputStream ; 24 import java.io.OutputStream ; 25 import java.util.zip.GZIPInputStream ; 26 import java.util.zip.GZIPOutputStream ; 27 28 33 public class GzipFileObject extends CompressedFileFileObject 34 { 35 protected GzipFileObject(FileName name, FileObject container, CompressedFileFileSystem fs) 36 { 37 super(name, container, fs); 38 } 39 40 protected InputStream doGetInputStream() throws Exception 41 { 42 InputStream is = getContainer().getContent().getInputStream(); 43 return new GZIPInputStream (is); 44 } 45 46 protected OutputStream doGetOutputStream(boolean bAppend) throws Exception 47 { 48 OutputStream os = getContainer().getContent().getOutputStream(false); 49 return new GZIPOutputStream (os); 50 } 51 } 52 | Popular Tags |