Top Inners Fields Constructors Methods
org.apache.poi.sl.usermodel

public final Class SlideShowFactory

extends Object
Class Inheritance
Annotations
@SuppressWarnings:java:S1452
Static Imports
org.apache.poi.extractor.ExtractorFactory.OOXML_PACKAGE, org.apache.poi.poifs.crypt.Decryptor.DEFAULT_POIFS_ENTRY

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static interface
private static class

Field Summary

Modifier and TypeField and Description
private final List<SlideShowProvider<?, ?>>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static void
public static SlideShow<?, ?>

Returns:

The created SlideShow
create
(boolean
If an XSLFSlideShow or a HSLFSlideShow should be created
XSLF
)

Create a new empty SlideShow, either XSLF or HSLF depending on the parameter

public static SlideShow<?, ?>

Returns:

The created SlideShow
create
(POIFSFileSystem
The POIFSFileSystem to read the document from
fs
)

Creates a HSLFSlideShow from the given POIFSFileSystem

Note that in order to properly release resources the SlideShow should be closed after use.

private static SlideShow<?, ?>

Returns:

The created SlideShow
create
(final POIFSFileSystem
The POIFSFileSystem to read the document from
fs
,
String
The password that should be used or null if no password is necessary.
password
)

Creates a SlideShow from the given POIFSFileSystem, which may be password protected

public static SlideShow<?, ?>

Returns:

The created SlideShow
create
(final DirectoryNode
The DirectoryNode to start reading the document from
root
)

Creates a SlideShow from the given DirectoryNode.

public static SlideShow<?, ?>

Returns:

The created SlideShow
create
(final DirectoryNode
The DirectoryNode to start reading the document from
root
,
String
The password that should be used or null if no password is necessary.
password
)

Creates a SlideShow from the given DirectoryNode, which may be password protected

public static SlideShow<?, ?>

Returns:

The created SlideShow
create
(InputStream
The InputStream to read data from.
inp
)

Creates the appropriate HSLFSlideShow / XSLFSlideShow from the given InputStream.

public static SlideShow<?, ?>

Returns:

The created SlideShow
create
(InputStream
The InputStream to read data from.
inp
,
String
The password that should be used or null if no password is necessary.
password
)

Creates the appropriate HSLFSlideShow / XSLFSlideShow from the given InputStream, which may be password protected.

public static SlideShow<?, ?>

Returns:

The created SlideShow
create
(File
The file to read data from.
file
)

Creates the appropriate HSLFSlideShow / XSLFSlideShow from the given File, which must exist and be readable.

public static SlideShow<?, ?>

Returns:

The created SlideShow
create
(File
The file to read data from.
file
,
String
The password that should be used or null if no password is necessary.
password
)

Creates the appropriate HSLFSlideShow / XSLFSlideShow from the given File, which must exist and be readable, and may be password protected

Note that in order to properly release resources the SlideShow should be closed after use.

public static SlideShow<?, ?>

Returns:

The created SlideShow
create
(File
The file to read data from.
file
,
String
The password that should be used or null if no password is necessary.
password
,
boolean
If the SlideShow should be opened in read-only mode to avoid writing back changes when the document is closed.
readOnly
)

Creates the appropriate HSLFSlideShow / XSLFSlideShow from the given File, which must exist and be readable, and may be password protected

Note that in order to properly release resources the SlideShow should be closed after use.

public static void
removeProvider(Class<? extends SlideShowProvider<?, ?>> provider)

private static SlideShow<?, ?>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

providerback to summary
private final List<SlideShowProvider<?, ?>> provider

Constructor Detail

SlideShowFactoryback to summary
private SlideShowFactory()

Method Detail

addProviderback to summary
public static void addProvider(SlideShowProvider<?, ?> provider)
createback to summary
public static SlideShow<?, ?> create(boolean XSLF) throws IOException

Create a new empty SlideShow, either XSLF or HSLF depending on the parameter

Parameters
XSLF:boolean

If an XSLFSlideShow or a HSLFSlideShow should be created

Returns:SlideShow<?, ?>

The created SlideShow

Exceptions
IOException:
if an error occurs while creating the objects
createback to summary
public static SlideShow<?, ?> create(POIFSFileSystem fs) throws IOException

Creates a HSLFSlideShow from the given POIFSFileSystem

Note that in order to properly release resources the SlideShow should be closed after use.

Parameters
fs:POIFSFileSystem

The POIFSFileSystem to read the document from

Returns:SlideShow<?, ?>

The created SlideShow

Exceptions
IOException:
if an error occurs while reading the data
createback to summary
private static SlideShow<?, ?> create(final POIFSFileSystem fs, String password) throws IOException

Creates a SlideShow from the given POIFSFileSystem, which may be password protected

Parameters
fs:POIFSFileSystem

The POIFSFileSystem to read the document from

password:String

The password that should be used or null if no password is necessary.

Returns:SlideShow<?, ?>

The created SlideShow

Exceptions
IOException:
if an error occurs while reading the data
createback to summary
public static SlideShow<?, ?> create(final DirectoryNode root) throws IOException

Creates a SlideShow from the given DirectoryNode.

Parameters
root:DirectoryNode

The DirectoryNode to start reading the document from

Returns:SlideShow<?, ?>

The created SlideShow

Exceptions
IOException:
if an error occurs while reading the data
createback to summary
public static SlideShow<?, ?> create(final DirectoryNode root, String password) throws IOException

Creates a SlideShow from the given DirectoryNode, which may be password protected

Parameters
root:DirectoryNode

The DirectoryNode to start reading the document from

password:String

The password that should be used or null if no password is necessary.

Returns:SlideShow<?, ?>

The created SlideShow

Exceptions
IOException:
if an error occurs while reading the data
createback to summary
public static SlideShow<?, ?> create(InputStream inp) throws IOException, EncryptedDocumentException

Creates the appropriate HSLFSlideShow / XSLFSlideShow from the given InputStream.

Your input stream MUST either support mark/reset, or be wrapped as a BufferedInputStream! Note that using an InputStream has a higher memory footprint than using a File.

Note that in order to properly release resources the SlideShow should be closed after use. Note also that loading from an InputStream requires more memory than loading from a File, so prefer create(File) where possible.

Parameters
inp:InputStream

The InputStream to read data from.

Returns:SlideShow<?, ?>

The created SlideShow

Exceptions
IOException:
if an error occurs while reading the data
EncryptedDocumentException:
If the SlideShow given is password protected
createback to summary
public static SlideShow<?, ?> create(InputStream inp, String password) throws IOException, EncryptedDocumentException

Creates the appropriate HSLFSlideShow / XSLFSlideShow from the given InputStream, which may be password protected.

Your input stream MUST either support mark/reset, or be wrapped as a BufferedInputStream! Note that using an InputStream has a higher memory footprint than using a File.

Note that in order to properly release resources the SlideShow should be closed after use. Note also that loading from an InputStream requires more memory than loading from a File, so prefer create(File) where possible.

Parameters
inp:InputStream

The InputStream to read data from.

password:String

The password that should be used or null if no password is necessary.

Returns:SlideShow<?, ?>

The created SlideShow

Exceptions
IOException:
if an error occurs while reading the data
EncryptedDocumentException:
If the wrong password is given for a protected file
createback to summary
public static SlideShow<?, ?> create(File file) throws IOException, EncryptedDocumentException

Creates the appropriate HSLFSlideShow / XSLFSlideShow from the given File, which must exist and be readable.

Note that in order to properly release resources the SlideShow should be closed after use.

Parameters
file:File

The file to read data from.

Returns:SlideShow<?, ?>

The created SlideShow

Exceptions
IOException:
if an error occurs while reading the data
EncryptedDocumentException:
If the SlideShow given is password protected
createback to summary
public static SlideShow<?, ?> create(File file, String password) throws IOException, EncryptedDocumentException

Creates the appropriate HSLFSlideShow / XSLFSlideShow from the given File, which must exist and be readable, and may be password protected

Note that in order to properly release resources the SlideShow should be closed after use.

Parameters
file:File

The file to read data from.

password:String

The password that should be used or null if no password is necessary.

Returns:SlideShow<?, ?>

The created SlideShow

Exceptions
IOException:
if an error occurs while reading the data
EncryptedDocumentException:
If the wrong password is given for a protected file
createback to summary
public static SlideShow<?, ?> create(File file, String password, boolean readOnly) throws IOException, EncryptedDocumentException

Creates the appropriate HSLFSlideShow / XSLFSlideShow from the given File, which must exist and be readable, and may be password protected

Note that in order to properly release resources the SlideShow should be closed after use.

Parameters
file:File

The file to read data from.

password:String

The password that should be used or null if no password is necessary.

readOnly:boolean

If the SlideShow should be opened in read-only mode to avoid writing back changes when the document is closed.

Returns:SlideShow<?, ?>

The created SlideShow

Exceptions
IOException:
if an error occurs while reading the data
EncryptedDocumentException:
If the wrong password is given for a protected file
removeProviderback to summary
public static void removeProvider(Class<? extends SlideShowProvider<?, ?>> provider)
wpback to summary
private static SlideShow<?, ?> wp(FileMagic fm, SlideShowFactory.ProviderMethod fun) throws IOException
org.apache.poi.sl.usermodel back to summary

private Interface SlideShowFactory.ProviderMethod


Method Summary

Modifier and TypeMethod and Description
public SlideShow<?, ?>

Method Detail

createback to summary
public SlideShow<?, ?> create(SlideShowProvider<?, ?> prov) throws IOException
org.apache.poi.sl.usermodel back to summary

private Class SlideShowFactory.Singleton

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final SlideShowFactory

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
private static final SlideShowFactory INSTANCE

Constructor Detail

Singletonback to summary
private Singleton()