@Test public void testExtractInlineImages() throws Exception { File tempFile = File.createTempFile("tika-test-", ""); assertTrue(tempFile.delete()); assertTrue(tempFile.mkdir()); try { String[] params = {"--extract-dir="+tempFile.getAbsolutePath(),"-z", resourcePrefix + "/testPDF_childAttachments.pdf"}; TikaCLI.main(params); String[] tempFileNames = tempFile.list(); assertNotNull(tempFileNames); String allFiles = String.join(" : ", tempFileNames); File jpeg = new File(tempFile, "image0.jpg"); File jobOptions = new File(tempFile, "Press Quality(1).joboptions"); File doc = new File(tempFile, "Unit10.doc"); assertExtracted(jpeg, allFiles); assertExtracted(jobOptions, allFiles); assertExtracted(doc, allFiles); } finally { FileUtils.deleteDirectory(tempFile); } }
public static void main(String[] args) throws Exception { TikaCLI cli = new TikaCLI(); if (!isConfigured()) { try (InputStream is = cli.getClass().getResourceAsStream("/log4j.properties")) { PropertyConfigurator.configure(is); } } if (cli.testForHelp(args)) { cli.usage(); return; } else if (cli.testForBatch(args)) { String[] batchArgs = BatchCommandLineBuilder.build(args); BatchProcessDriverCLI batchDriver = new BatchProcessDriverCLI(batchArgs); batchDriver.execute(); return; } if (args.length > 0) { for (int i = 0; i < args.length; i++) { cli.process(args[i]); } if (cli.pipeMode) { cli.process("-"); } } else { if (System.in.available() == 0) { Thread.sleep(100); } if (System.in.available() > 0) { cli.process("-"); } else { cli.process("--gui"); } } }
TikaCLI { public static void main(String[] args) throws Exception { TikaCLI cli = new TikaCLI(); if (!isConfigured()) { try (InputStream is = cli.getClass().getResourceAsStream("/log4j.properties")) { PropertyConfigurator.configure(is); } } if (cli.testForHelp(args)) { cli.usage(); return; } else if (cli.testForBatch(args)) { String[] batchArgs = BatchCommandLineBuilder.build(args); BatchProcessDriverCLI batchDriver = new BatchProcessDriverCLI(batchArgs); batchDriver.execute(); return; } if (args.length > 0) { for (int i = 0; i < args.length; i++) { cli.process(args[i]); } if (cli.pipeMode) { cli.process("-"); } } else { if (System.in.available() == 0) { Thread.sleep(100); } if (System.in.available() > 0) { cli.process("-"); } else { cli.process("--gui"); } } } }
TikaCLI { public static void main(String[] args) throws Exception { TikaCLI cli = new TikaCLI(); if (!isConfigured()) { try (InputStream is = cli.getClass().getResourceAsStream("/log4j.properties")) { PropertyConfigurator.configure(is); } } if (cli.testForHelp(args)) { cli.usage(); return; } else if (cli.testForBatch(args)) { String[] batchArgs = BatchCommandLineBuilder.build(args); BatchProcessDriverCLI batchDriver = new BatchProcessDriverCLI(batchArgs); batchDriver.execute(); return; } if (args.length > 0) { for (int i = 0; i < args.length; i++) { cli.process(args[i]); } if (cli.pipeMode) { cli.process("-"); } } else { if (System.in.available() == 0) { Thread.sleep(100); } if (System.in.available() > 0) { cli.process("-"); } else { cli.process("--gui"); } } } TikaCLI(); }
TikaCLI { public static void main(String[] args) throws Exception { TikaCLI cli = new TikaCLI(); if (!isConfigured()) { try (InputStream is = cli.getClass().getResourceAsStream("/log4j.properties")) { PropertyConfigurator.configure(is); } } if (cli.testForHelp(args)) { cli.usage(); return; } else if (cli.testForBatch(args)) { String[] batchArgs = BatchCommandLineBuilder.build(args); BatchProcessDriverCLI batchDriver = new BatchProcessDriverCLI(batchArgs); batchDriver.execute(); return; } if (args.length > 0) { for (int i = 0; i < args.length; i++) { cli.process(args[i]); } if (cli.pipeMode) { cli.process("-"); } } else { if (System.in.available() == 0) { Thread.sleep(100); } if (System.in.available() > 0) { cli.process("-"); } else { cli.process("--gui"); } } } TikaCLI(); static void main(String[] args); void process(String arg); }
TikaCLI { public static void main(String[] args) throws Exception { TikaCLI cli = new TikaCLI(); if (!isConfigured()) { try (InputStream is = cli.getClass().getResourceAsStream("/log4j.properties")) { PropertyConfigurator.configure(is); } } if (cli.testForHelp(args)) { cli.usage(); return; } else if (cli.testForBatch(args)) { String[] batchArgs = BatchCommandLineBuilder.build(args); BatchProcessDriverCLI batchDriver = new BatchProcessDriverCLI(batchArgs); batchDriver.execute(); return; } if (args.length > 0) { for (int i = 0; i < args.length; i++) { cli.process(args[i]); } if (cli.pipeMode) { cli.process("-"); } } else { if (System.in.available() == 0) { Thread.sleep(100); } if (System.in.available() > 0) { cli.process("-"); } else { cli.process("--gui"); } } } TikaCLI(); static void main(String[] args); void process(String arg);  }