public MechFileParser(File f, String entryName) throws EntityLoadingException { if (entryName == null) {  try { parse(new FileInputStream(f), f.getName()); } catch (Exception ex) { if (ex instanceof EntityLoadingException) { throw new EntityLoadingException("While parsing file " + f.getName() + ", " + ex.getMessage()); } else { throw new EntityLoadingException("Exception from " + ex.getClass() + ": " + ex.getMessage()); } } } else {  ZipFile zFile; try { zFile = new ZipFile(f); parse(zFile.getInputStream(zFile.getEntry(entryName)), entryName); } catch (Exception ex) { if (ex instanceof EntityLoadingException) { throw new EntityLoadingException(ex.getMessage()); } else { throw new EntityLoadingException("Exception from " + ex.getClass() + ": " + ex.getMessage()); } } }
public MechFileParser(File f) throws EntityLoadingException { this(f, null);
    public MechFileParser(File f, String entryName) throws EntityLoadingException {        if (entryName == null) {            // try normal file            try {                parse(new FileInputStream(f), f.getName());            } catch (Exception ex) {                if (ex instanceof EntityLoadingException) {                    throw new EntityLoadingException("While parsing file " + f.getName() + ", " + ex.getMessage());                } else {                    throw new EntityLoadingException("Exception from " + ex.getClass() + ": " + ex.getMessage());                }            }        } else {            // try zip file            ZipFile zFile;            try {                zFile = new ZipFile(f);                parse(zFile.getInputStream(zFile.getEntry(entryName)), entryName);            } catch (Exception ex) {                if (ex instanceof EntityLoadingException) {                    throw new EntityLoadingException(ex.getMessage());                } else {                    throw new EntityLoadingException("Exception from " + ex.getClass() + ": " + ex.getMessage());                }            }        }    }