Class SlideShowFactory
- java.lang.Object
-
- org.apache.poi.sl.usermodel.SlideShowFactory
-
public final class SlideShowFactory extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addProvider(SlideShowProvider<?,?> provider)
static SlideShow<?,?>
create(boolean XSLF)
Create a new empty SlideShow, either XSLF or HSLF depending on the parameterstatic SlideShow<?,?>
create(File file)
Creates the appropriate HSLFSlideShow / XSLFSlideShow from the given File, which must exist and be readable.static SlideShow<?,?>
create(File file, String password)
Creates the appropriate HSLFSlideShow / XSLFSlideShow from the given File, which must exist and be readable, and may be password protectedstatic SlideShow<?,?>
create(File file, String password, boolean readOnly)
Creates the appropriate HSLFSlideShow / XSLFSlideShow from the given File, which must exist and be readable, and may be password protectedstatic SlideShow<?,?>
create(InputStream inp)
Creates the appropriate HSLFSlideShow / XSLFSlideShow from the given InputStream.static SlideShow<?,?>
create(InputStream inp, String password)
Creates the appropriate HSLFSlideShow / XSLFSlideShow from the given InputStream, which may be password protected.static SlideShow<?,?>
create(DirectoryNode root)
Creates a SlideShow from the given DirectoryNode.static SlideShow<?,?>
create(DirectoryNode root, String password)
Creates a SlideShow from the given DirectoryNode, which may be password protectedstatic SlideShow<?,?>
create(POIFSFileSystem fs)
Creates a HSLFSlideShow from the given POIFSFileSystemstatic void
removeProvider(Class<? extends SlideShowProvider<?,?>> provider)
-
-
-
Method Detail
-
create
public static SlideShow<?,?> create(boolean XSLF) throws IOException
Create a new empty SlideShow, either XSLF or HSLF depending on the parameter- Parameters:
XSLF
- If an XSLFSlideShow or a HSLFSlideShow should be created- Returns:
- The created SlideShow
- Throws:
IOException
- if an error occurs while creating the objects
-
create
public static SlideShow<?,?> create(POIFSFileSystem fs) throws IOException
Creates a HSLFSlideShow from the given POIFSFileSystemNote that in order to properly release resources the SlideShow should be closed after use.
- Parameters:
fs
- ThePOIFSFileSystem
to read the document from- Returns:
- The created SlideShow
- Throws:
IOException
- if an error occurs while reading the data
-
create
public static SlideShow<?,?> create(DirectoryNode root) throws IOException
Creates a SlideShow from the given DirectoryNode.- Parameters:
root
- TheDirectoryNode
to start reading the document from- Returns:
- The created SlideShow
- Throws:
IOException
- if an error occurs while reading the data
-
create
public static SlideShow<?,?> create(DirectoryNode root, String password) throws IOException
Creates a SlideShow from the given DirectoryNode, which may be password protected- Parameters:
root
- TheDirectoryNode
to start reading the document frompassword
- The password that should be used or null if no password is necessary.- Returns:
- The created SlideShow
- Throws:
IOException
- if an error occurs while reading the data
-
create
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 anInputStream
has a higher memory footprint than using aFile
.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
- TheInputStream
to read data from.- Returns:
- The created SlideShow
- Throws:
IOException
- if an error occurs while reading the dataEncryptedDocumentException
- If the SlideShow given is password protected
-
create
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 anInputStream
has a higher memory footprint than using aFile
.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
- TheInputStream
to read data from.password
- The password that should be used or null if no password is necessary.- Returns:
- The created SlideShow
- Throws:
IOException
- if an error occurs while reading the dataEncryptedDocumentException
- If the wrong password is given for a protected file
-
create
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
- The file to read data from.- Returns:
- The created SlideShow
- Throws:
IOException
- if an error occurs while reading the dataEncryptedDocumentException
- If the SlideShow given is password protected
-
create
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 protectedNote that in order to properly release resources the SlideShow should be closed after use.
- Parameters:
file
- The file to read data from.password
- The password that should be used or null if no password is necessary.- Returns:
- The created SlideShow
- Throws:
IOException
- if an error occurs while reading the dataEncryptedDocumentException
- If the wrong password is given for a protected file
-
create
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 protectedNote that in order to properly release resources the SlideShow should be closed after use.
- Parameters:
file
- The file to read data from.password
- The password that should be used or null if no password is necessary.readOnly
- If the SlideShow should be opened in read-only mode to avoid writing back changes when the document is closed.- Returns:
- The created SlideShow
- Throws:
IOException
- if an error occurs while reading the dataEncryptedDocumentException
- If the wrong password is given for a protected file
-
addProvider
public static void addProvider(SlideShowProvider<?,?> provider)
-
removeProvider
public static void removeProvider(Class<? extends SlideShowProvider<?,?>> provider)
-
-