public RarStream(final File file, final Executor executor) throws Exception { rarArchive = new Archive(file); this.executor = executor; }
return; Archive rarFile = new Archive(new NativeStorage(new File(rarFilePath))); de.innosystec.unrar.rarfile.FileHeader fileHeader = null; final int total = rarFile.getFileHeaders().size();
Archive a=null; try { a = new Archive(new NativeStorage(f)); } catch (RarException e) {
public void parse( InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context) throws SAXException, IOException, TikaException { EmbeddedDocumentExtractor extractor = new EmbeddedDocumentExtractor(context); try { File file = TikaInputStream.get(stream).getFile(); Archive archive = new Archive(new NativeStorage(file)); metadata.set(Metadata.CONTENT_TYPE, TYPE.toString()); XHTMLContentHandler xhtml = new XHTMLContentHandler(handler, metadata); xhtml.startDocument(); for (FileHeader header : archive.getFileHeaders()) { Metadata entrydata = new Metadata(); entrydata.set( Metadata.RESOURCE_NAME_KEY, header.getFileNameString()); if (extractor.shouldParseEmbedded(entrydata)) { extractor.parseEmbedded(stream, xhtml, entrydata, true); } } xhtml.endDocument(); } catch (RarException e) { throw new TikaException("Unable to parse a RAR archive", e); } }