public static void main(String[] args) throws Exception {
        // Create a Tika instance with the default configuration
        Tika tika = new Tika();

        // Parse all given files and print out the extracted
        // text content
        for (String file : args) {
            String text = tika.parseToString(new File(file));
            System.out.print(text);
        }
    }
@Test
    public void testSimpleTextExtractor() throws Exception {
        String message =
                "This is Tika - Hello, World! This is simple UTF-8 text" + " content written in English to test autodetection of" + " the character encoding of the input stream.";
        ByteArrayOutputStream buffer = new ByteArrayOutputStream();

        PrintStream out = System.out;
        System.setOut(new PrintStream(buffer, true, UTF_8.name()));

        File file = new File("target", "test.txt");
        FileUtils.writeStringToFile(file, message, UTF_8);
        SimpleTextExtractor.main(new String[]{file.getPath()});
        file.delete();

        System.setOut(out);

        assertContains(message, buffer
                .toString(UTF_8.name())
                .trim());
    }