org.apache.tika.utils
Class Utils

java.lang.Object
  extended by org.apache.tika.utils.Utils

public class Utils
extends java.lang.Object

Class util


Constructor Summary
Utils()
           
 
Method Summary
static java.io.Reader getUTF8Reader(java.io.InputStream stream, Metadata metadata)
          Try to detect encoding from inputstream and return a UTF-8 Reader.
static org.jdom.Document parse(java.io.InputStream is)
           
static void saveInXmlFile(org.jdom.Document doc, java.lang.String file)
           
static java.util.List unzip(java.io.InputStream is)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

parse

public static org.jdom.Document parse(java.io.InputStream is)

unzip

public static java.util.List unzip(java.io.InputStream is)

saveInXmlFile

public static void saveInXmlFile(org.jdom.Document doc,
                                 java.lang.String file)

getUTF8Reader

public static java.io.Reader getUTF8Reader(java.io.InputStream stream,
                                           Metadata metadata)
                                    throws TikaException,
                                           java.io.IOException
Try to detect encoding from inputstream and return a UTF-8 Reader. A metadata hint can be submitted as part of Metadata under key HttpHeaders.CONTENT_ENCODING. After succesfull detection, fills Metadata with detected content encoding and content language (HttpHeaders.CONTENT_LANGUAGE).

Returns:
Reader to utf8 encoded reader.
Throws:
TikaException
java.io.IOException


Copyright © 2008 The Apache Software Foundation. All Rights Reserved.