public RarException(RarException e) { super(e.getMessage(),e); this.type = e.getType(); }
public RarException(Exception e){ super(RarExceptionType.unkownError.name(),e); this.type = RarExceptionType.unkownError; }
/** * Extract the file specified by the given header and write it to the * supplied output stream * * @param header * the header to be extracted * @param os * the outputstream * @throws RarException */ public void extractFile(FileHeader hd, OutputStream os) throws RarException { if (!headers.contains(hd)) { throw new RarException(RarExceptionType.headerNotInArchive); } try { doExtractFile(hd, os); } catch (Exception e) { if (e instanceof RarException) { throw (RarException) e; } else { throw new RarException(e); } } }
} catch (RarException e) { e.printStackTrace(); } catch (IOException e) { } catch (RarException e) { e.printStackTrace(); } catch (IOException e) {
int expectedCRC = hd.getFileCRC(); if (actualCRC != expectedCRC) { throw new RarException(RarExceptionType.crcError); throw new RarException(e);
public RarException(RarExceptionType type){ super(type.name()); this.type = type; }
markHead = new MarkHeader(block); if (!markHead.isSignature()) { throw new RarException( RarException.RarExceptionType.badRarArchive); this.newMhd = mainhead; if (newMhd.isEncrypted()) { throw new RarException( RarExceptionType.rarEncryptedException); throw new RarException(RarExceptionType.notRarArchive);