1 /* 2 * FileReader.java 3 * 4 * Created on 8. November 2006, 19:42 5 */ 6 /* 7 * Copyright 2006 Schlichtherle IT Services 8 * 9 * Licensed under the Apache License, Version 2.0 (the "License"); 10 * you may not use this file except in compliance with the License. 11 * You may obtain a copy of the License at 12 * 13 * http://www.apache.org/licenses/LICENSE-2.0 14 * 15 * Unless required by applicable law or agreed to in writing, software 16 * distributed under the License is distributed on an "AS IS" BASIS, 17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 * See the License for the specific language governing permissions and 19 * limitations under the License. 20 */ 21 22 package de.schlichtherle.io; 23 24 import java.io.FileDescriptor; 25 import java.io.FileNotFoundException; 26 import java.io.InputStreamReader; 27 28 /** 29 * A <em>drop-in-replacement</em> for <code>java.io.FileReader</code> 30 * which provides transparent access to archive files as if they were just 31 * directories in a path name. 32 * To read an entry in an archive file, simply create an instance 33 * of this class with a path name that contains the archive file as one 34 * of the parent directories. 35 * The remainder of the path name will then be used as the relative path 36 * of the entry in the archive file to be read. 37 * 38 * @see FileInputStream 39 * @see File#umount() 40 * @see <a HREF="package-summary.html#package_description">Package Description</a> 41 * @author Christian Schlichtherle 42 * @version @version@ 43 * @since TrueZIP 6.4 44 */ 45 public class FileReader extends InputStreamReader { 46 47 public FileReader(String path) throws FileNotFoundException { 48 super(new FileInputStream(path)); 49 } 50 51 public FileReader(File file) throws FileNotFoundException { 52 super(new FileInputStream(file)); 53 } 54 55 public FileReader(FileDescriptor fd) { 56 super(new FileInputStream(fd)); 57 } 58 } 59