1 2 package org.catacomb.dataview.read; 3 4 5 import org.catacomb.dataview.read.Importer; 6 7 8 import java.io.File; 9 10 11 public class FileImportContext extends FUImportContext { 12 13 File baseFile; 14 File baseDir; 15 16 17 public FileImportContext(File f) { 18 baseFile = f; 19 baseDir = f.getParentFile(); 20 } 21 22 23 public boolean hasRelative(String sr) { 24 File fr = new File(baseDir, sr); 25 return (fr.exists()); 26 } 27 28 29 30 public File getRelativeFile(String sr) { 31 File fr = new File(baseDir, sr); 32 return fr; 33 } 34 35 36 public ContentReader getRelativeReader(String sr) { 37 File file = getRelativeFile(sr); 38 return Importer.getReader(file); 39 } 40 41 42 public String getExtensionRelativeName(String ext) { 43 return getReExtendedName(baseFile.getName(), ext); 44 } 45 46 47 48 }