import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.zip.ZipFile; public class X { private String fXLocation; private boolean fXLocationIsZip; private transient private X() { //intentionally left blank } public static X makeX(String pXLocation) throws IOException { X lNew = new X(); File lFile; lNew.fXLocation = pXLocation; lFile = new File(lNew.fXLocation); if ( !lFile.exists() ) { throw new FileNotFoundException( "X '" + pXLocation + "' not found."); } lNew.fXLocationIsZip = !lFile.isDirectory(); return lNew; } public static void setTempDirectory(String pTemp) { sTempDirectory = pTemp; } private InputStream getResource(String pResourceName) throws IOException { if ( fXLocationIsZip ) { return getResourceFromZip(pResourceName); } else { return getResourceFromDir(pResourceName); } } private InputStream getResourceFromZip(String pResourceName) throws IOException { ZipFile lZipFile; lZipFile = new ZipFile(fXLocation); } }