public class POIFSReader
extends java.lang.Object
Constructor and Description |
---|
POIFSReader() |
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args)
read in files
(读入文件)
|
void |
read(java.io.File poifsFile)
Read from a File and process the documents we get
(从文件中读取并处理我们得到的文件)
|
void |
read(java.io.InputStream stream)
Read from an InputStream and process the documents we get
(从 InputStream 中读取并处理我们得到的文档)
|
void |
read(POIFSFileSystem poifs)
Read from a
POIFSFileSystem and process the documents we get
(从 POIFSFileSystem 读取并处理我们得到的文档)
|
void |
registerListener(POIFSReaderListener listener)
Register a POIFSReaderListener for all documents
(为所有文档注册一个 POIFSReaderListener)
|
void |
registerListener(POIFSReaderListener listener, POIFSDocumentPath path, java.lang.String name)
Register a POIFSReaderListener for a document in the specified directory
(为指定目录中的文档注册 POIFSReaderListener)
|
void |
registerListener(POIFSReaderListener listener, java.lang.String name)
Register a POIFSReaderListener for a document in the root directory
(为根目录中的文档注册一个 POIFSReaderListener)
|
void |
setNotifyEmptyDirectories(boolean notifyEmptyDirectories)
Activates the notification of empty directories.
(激活空目录的通知。)
|
public void read(java.io.InputStream stream) throws java.io.IOException
stream
- the InputStream from which to read the data
(stream - 从中读取数据的 InputStream)
java.io.IOException
- on errors reading, or on invalid data
(java.io.IOException - 读取错误或无效数据)
public void read(java.io.File poifsFile) throws java.io.IOException
poifsFile
- the file from which to read the data
(poifsFile - 从中读取数据的文件)
java.io.IOException
- on errors reading, or on invalid data
(java.io.IOException - 读取错误或无效数据)
public void read(POIFSFileSystem poifs) throws java.io.IOException
POIFSFileSystem
and process the documents we get
(从 POIFSFileSystem 读取并处理我们得到的文档)
poifs
- the POIFSFileSystem from which to read the data
(poifs - 从中读取数据的 POIFSFileSystem)
java.io.IOException
- on errors reading, or on invalid data
(java.io.IOException - 读取错误或无效数据)
public void registerListener(POIFSReaderListener listener)
listener
- the listener to be registered
(listener - 要注册的侦听器)
java.lang.NullPointerException
- if listener is null
(java.lang.NullPointerException - 如果监听器为空)
java.lang.IllegalStateException
- if read() has already been called
(java.lang.IllegalStateException - 如果 read() 已经被调用)
public void registerListener(POIFSReaderListener listener, java.lang.String name)
listener
- the listener to be registered
(listener - 要注册的侦听器)
name
- the document name
(name - 文档名称)
java.lang.NullPointerException
- if listener is null or name is null or empty
(java.lang.NullPointerException - 如果 listener 为 null 或 name 为 null 或为空)
java.lang.IllegalStateException
- if read() has already been called
(java.lang.IllegalStateException - 如果 read() 已经被调用)
public void registerListener(POIFSReaderListener listener, POIFSDocumentPath path, java.lang.String name)
listener
- the listener to be registered
(listener - 要注册的侦听器)
path
- the document path; if null, the root directory is assumed
(path - 文档路径;如果为 null,则假定为根目录)
name
- the document name
(name - 文档名称)
java.lang.NullPointerException
- if listener is null or name is null or empty
(java.lang.NullPointerException - 如果 listener 为 null 或 name 为 null 或为空)
java.lang.IllegalStateException
- if read() has already been called
(java.lang.IllegalStateException - 如果 read() 已经被调用)
public void setNotifyEmptyDirectories(boolean notifyEmptyDirectories)
If this flag is activated, the listener
receives POIFSReaderEvents
with nulled name
and stream
notifyEmptyDirectories
- if
true
, empty directories will be notified
(notifyEmptyDirectories - 如果为 true,将通知空目录)
public static void main(java.lang.String[] args) throws java.io.IOException
args
- names of the files
(args - 文件名)
java.io.IOException
- if the files can't be read or have invalid content
(java.io.IOException - 如果文件无法读取或内容无效)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.