@Override public void print() { super.print(); StringBuilder str = new StringBuilder(); str.append("unpSize: " + getUnpSize()); str.append("\nHostOS: " + hostOS.name()); str.append("\nMDate: " + mTime); str.append("\nFileName: " + getFileNameString()); str.append("\nunpMethod: " + Integer.toHexString(getUnpMethod())); str.append("\nunpVersion: " + Integer.toHexString(getUnpVersion())); str.append("\nfullpackedsize: " + getFullPackSize()); str.append("\nfullunpackedsize: " + getFullUnpackSize()); str.append("\nisEncrypted: " + isEncrypted()); str.append("\nisfileHeader: " + isFileHeader()); str.append("\nisSolid: " + isSolid()); str.append("\nisSplitafter: " + isSplitAfter()); str.append("\nisSplitBefore:" + isSplitBefore()); str.append("\nunpSize: " + getUnpSize()); str.append("\ndataSize: " + getDataSize()); str.append("\nisUnicode: " + isUnicode()); str.append("\nhasVolumeNumber: " + hasVolumeNumber()); str.append("\nhasArchiveDataCRC: " + hasArchiveDataCRC()); str.append("\nhasSalt: " + hasSalt()); str.append("\nhasEncryptVersions: " + hasEncryptVersion()); str.append("\nisSubBlock: " + isSubBlock()); logger.info(str.toString()); }
public static List<ContentDescription> getContentsDescription(final File rar) throws RarException, IOException { validateRarPath(rar); final Archive arch = createArchiveOrThrowException(logger, rar); final List<ContentDescription> contents = new ArrayList<ContentDescription>(); try{ if (arch.isEncrypted()) { logger.warn("archive is encrypted cannot extract"); return new ArrayList<ContentDescription>(); } for(final FileHeader fileHeader : arch ) { contents.add(new ContentDescription(fileHeader.getFileNameString(), fileHeader.getUnpSize())); } }finally { arch.close(); } return contents; }
@Override public void print() { super.print(); StringBuilder str = new StringBuilder(); str.append("unpSize: " + getUnpSize()); str.append("\nHostOS: " + hostOS.name()); str.append("\nMDate: " + mTime); str.append("\nFileName: " + getFileNameString()); str.append("\nunpMethod: " + Integer.toHexString(getUnpMethod())); str.append("\nunpVersion: " + Integer.toHexString(getUnpVersion())); str.append("\nfullpackedsize: " + getFullPackSize()); str.append("\nfullunpackedsize: " + getFullUnpackSize()); str.append("\nisEncrypted: " + isEncrypted()); str.append("\nisfileHeader: " + isFileHeader()); str.append("\nisSolid: " + isSolid()); str.append("\nisSplitafter: " + isSplitAfter()); str.append("\nisSplitBefore:" + isSplitBefore()); str.append("\nunpSize: " + getUnpSize()); str.append("\ndataSize: " + getDataSize()); str.append("\nisUnicode: " + isUnicode()); str.append("\nhasVolumeNumber: " + hasVolumeNumber()); str.append("\nhasArchiveDataCRC: " + hasArchiveDataCRC()); str.append("\nhasSalt: " + hasSalt()); str.append("\nhasEncryptVersions: " + hasEncryptVersion()); str.append("\nisSubBlock: " + isSubBlock()); logger.info(str.toString()); }
private void processEntry(FileHeader entry, Archive archive, URI uri, String newPath) throws CommandExecutionException, IOException, RarException { String name = entry.getFileNameString(); if (!entry.isDirectory()) { final RequestMetaData metaData = new RequestMetaData(entry.getUnpSize(), 2L, name); final RequestIdentifier identifier = new RequestIdentifier(uri); RarIdentificationRequest req = new RarIdentificationRequest(metaData, identifier, getTmpDir()); expandContainer(req, archive.getInputStream(entry), newPath); } else { log.trace("processing directory : " + entry.getFileNameString()); } } }
private void submitFile(FileHeader entry) throws IOException, URISyntaxException, RarException { String fullpath = entry.getFileNameString(); String path = FilenameUtils.getPath(fullpath); String name = FilenameUtils.getName(fullpath); //CHECKSTYLE:OFF log.debug("submitFile, processing path: " + path + " name: " + name); //CHECKSTYLE:ON ResourceId correlationId = getFromDirCache(path); if (correlationId == null) { correlationId = submitDirectory(path, entry.getMTime()); } InputStream entryInputStream = archive.getInputStream(entry); RequestIdentifier identifier = new RequestIdentifier(ArchiveFileUtils.toRarUri(parentURI, path + name)); identifier.setAncestorId(originatorNodeId); identifier.setParentResourceId(correlationId); RequestMetaData metaData = new RequestMetaData(entry.getUnpSize(), entry.getMTime().getTime(), name); IdentificationRequest<InputStream> request = identificationRequestFactory.newRequest(metaData, identifier); request.open(entryInputStream); droid.submit(request); }
private void submitFile(FileHeader entry) throws IOException, URISyntaxException, RarException { String fullpath = entry.getFileNameString(); String path = FilenameUtils.getPath(fullpath); String name = FilenameUtils.getName(fullpath); //CHECKSTYLE:OFF log.debug("submitFile, processing path: " + path + " name: " + name); //CHECKSTYLE:ON ResourceId correlationId = getFromDirCache(path); if (correlationId == null) { correlationId = submitDirectory(path, entry.getMTime()); } InputStream entryInputStream = archive.getInputStream(entry); RequestIdentifier identifier = new RequestIdentifier(ArchiveFileUtils.toRarUri(parentURI, path + name)); identifier.setAncestorId(originatorNodeId); identifier.setParentResourceId(correlationId); RequestMetaData metaData = new RequestMetaData(entry.getUnpSize(), entry.getMTime().getTime(), name); IdentificationRequest<InputStream> request = identificationRequestFactory.newRequest(metaData, identifier); request.open(entryInputStream); droid.submit(request); }