@Override protected long doGetLastModifiedTime() throws Exception { return header.getMTime().getTime(); }
@Override protected long doGetLastModifiedTime() throws Exception { return header.getMTime().getTime(); }
Metadata entrydata = PackageParser.handleEntryMetadata( "".equals(header.getFileNameW()) ? header.getFileNameString() : header.getFileNameW(), header.getCTime(), header.getMTime(), header.getFullUnpackSize(), xhtml
/** * Creates and return an {@link ArchiveEntry()} whose attributes are fetched from the given {@link com.github.junrar.rarfile.FileHeader} * * @param header the object that serves to initialize the attributes of the returned ArchiveEntry * @return an ArchiveEntry whose attributes are fetched from the given FileHeader */ private ArchiveEntry createArchiveEntry(FileHeader header) { return new ArchiveEntry( header.getFileNameString().replace('\\', '/'), header.isDirectory(), header.getMTime().getTime(), header.getFullUnpackSize(), true ); }
@Override protected void handleEntry(FileHeader entry) throws IOException { try { if (entry.isDirectory()) { String path = entry.getFileNameString(); if (!(path.endsWith(UNIX_PATH_SPLITTER) || path.endsWith(WINDOWS_PATH_SPLITTER))) { path += UNIX_PATH_SPLITTER; } submitDirectory(path, entry.getMTime()); } else if (entry.isEncrypted()) { throw new RuntimeException("Encrypted entry : " + entry.getFileNameString()); } else { submitFile(entry); } } catch (URISyntaxException ex) { throw new RuntimeException("Malformed uri for entry : " + entry.getFileNameString(), ex); } catch (RarException rarEx) { throw new RuntimeException("Probem with RAR extraction : " + entry.getFileNameString(), rarEx); } } }
@Override protected void handleEntry(FileHeader entry) throws IOException { try { if (entry.isDirectory()) { String path = entry.getFileNameString(); if (!(path.endsWith(UNIX_PATH_SPLITTER) || path.endsWith(WINDOWS_PATH_SPLITTER))) { path += UNIX_PATH_SPLITTER; } submitDirectory(path, entry.getMTime()); } else if (entry.isEncrypted()) { throw new RuntimeException("Encrypted entry : " + entry.getFileNameString()); } else { submitFile(entry); } } catch (URISyntaxException ex) { throw new RuntimeException("Malformed uri for entry : " + entry.getFileNameString(), ex); } catch (RarException rarEx) { throw new RuntimeException("Probem with RAR extraction : " + entry.getFileNameString(), rarEx); } } }
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); }
Metadata entrydata = PackageParser.handleEntryMetadata( "".equals(header.getFileNameW()) ? header.getFileNameString() : header.getFileNameW(), header.getCTime(), header.getMTime(), header.getFullUnpackSize(), xhtml
Metadata entrydata = PackageParser.handleEntryMetadata( "".equals(header.getFileNameW()) ? header.getFileNameString() : header.getFileNameW(), header.getCTime(), header.getMTime(), header.getFullUnpackSize(), xhtml