public final class HSLFSlideShowImpl extends POIDocument implements java.io.Closeable
Constructor and Description |
---|
HSLFSlideShowImpl(DirectoryNode dir)
Constructs a Powerpoint document from a specific point in a
POIFS Filesystem.
|
HSLFSlideShowImpl(java.io.InputStream inputStream)
Constructs a Powerpoint document from an input stream.
|
HSLFSlideShowImpl(POIFSFileSystem filesystem)
Constructs a Powerpoint document from a POIFS Filesystem.
|
HSLFSlideShowImpl(java.lang.String fileName)
Constructs a Powerpoint document from fileName.
|
Modifier and Type | Method and Description |
---|---|
int |
addPicture(HSLFPictureData img)
Add a new picture to this presentation.
|
int |
appendRootLevelRecord(Record newRecord)
Adds a new root level record, at the end, but before the last
PersistPtrIncrementalBlock.
|
void |
close()
Closes the underlying
POIFSFileSystem from which
the document was read, if any. |
static HSLFSlideShowImpl |
create()
Constructs a new, empty, Powerpoint document.
|
CurrentUserAtom |
getCurrentUserAtom()
Fetch the Current User Atom of the document
|
DocumentEncryptionAtom |
getDocumentEncryptionAtom() |
HSLFObjectData[] |
getEmbeddedObjects()
Gets embedded object data from the slide show.
|
protected java.lang.String |
getEncryptedPropertyStreamName() |
EncryptionInfo |
getEncryptionInfo() |
java.util.List<HSLFPictureData> |
getPictureData()
Return list of pictures contained in this presentation
|
Record[] |
getRecords()
Returns an array of all the records found in the slideshow
|
byte[] |
getUnderlyingBytes()
Returns an array of the bytes of the file.
|
void |
normalizeRecords()
remove duplicated UserEditAtoms and merge PersistPtrHolder, i.e.
|
void |
updateAndWriteDependantRecords(java.io.OutputStream os,
java.util.Map<RecordTypes,PositionDependentRecord> interestingRecords)
This is a helper functions, which is needed for adding new position dependent records
or finally write the slideshow to a file.
|
void |
write()
Writes out the slideshow to the currently open file.
|
void |
write(java.io.File newFile)
Writes out the slideshow file the is represented by an instance
of this class.
|
void |
write(java.io.File newFile,
boolean preserveNodes)
Writes out the slideshow file the is represented by an instance
of this class.
|
void |
write(java.io.OutputStream out)
Writes out the slideshow file the is represented by an instance
of this class.
|
void |
write(java.io.OutputStream out,
boolean preserveNodes)
Writes out the slideshow file the is represented by an instance
of this class.
|
clearDirectory, createInformationProperties, getDirectory, getDocumentSummaryInformation, getPropertySet, getPropertySet, getSummaryInformation, initDirectory, readProperties, replaceDirectory, validateInPlaceWritePossible, writeProperties, writeProperties, writeProperties
public HSLFSlideShowImpl(java.lang.String fileName) throws java.io.IOException
fileName
- The name of the file to read.java.io.IOException
- if there is a problem while parsing the document.public HSLFSlideShowImpl(java.io.InputStream inputStream) throws java.io.IOException
inputStream
- the source of the datajava.io.IOException
- if there is a problem while parsing the document.public HSLFSlideShowImpl(POIFSFileSystem filesystem) throws java.io.IOException
filesystem
- the POIFS FileSystem to read fromjava.io.IOException
- if there is a problem while parsing the document.public HSLFSlideShowImpl(DirectoryNode dir) throws java.io.IOException
dir
- the POIFS directory to read fromjava.io.IOException
- if there is a problem while parsing the document.public static HSLFSlideShowImpl create()
public DocumentEncryptionAtom getDocumentEncryptionAtom()
public void normalizeRecords()
public void updateAndWriteDependantRecords(java.io.OutputStream os, java.util.Map<RecordTypes,PositionDependentRecord> interestingRecords) throws java.io.IOException
os
- the stream to write to, if null only the references are updatedinterestingRecords
- a map of interesting records (PersistPtrHolder and UserEditAtom)
referenced by their RecordType. Only the very last of each type will be saved to the map.
May be null, if not needed.java.io.IOException
public void write() throws java.io.IOException
This will fail (with an IllegalStateException
if the
slideshow was opened read-only, opened from an InputStream
instead of a File, or if this is not the root document. For those cases,
you must use write(OutputStream)
or write(File)
to
write to a brand new document.
write
in class POIDocument
java.io.IOException
- thrown on errors writing to the filejava.lang.IllegalStateException
- if this isn't from a writable Filepublic void write(java.io.File newFile) throws java.io.IOException
This will write out only the common OLE2 streams. If you require all
streams to be written out, use write(File, boolean)
with preserveNodes
set to true
.
write
in class POIDocument
newFile
- The File to write to.java.io.IOException
- If there is an unexpected IOException from writing to the Filepublic void write(java.io.File newFile, boolean preserveNodes) throws java.io.IOException
preserveNodes
set to true
newFile
- The File to write to.preserveNodes
- Should all OLE2 streams be written back out, or only the common ones?java.io.IOException
- If there is an unexpected IOException from writing to the Filepublic void write(java.io.OutputStream out) throws java.io.IOException
This will write out only the common OLE2 streams. If you require all
streams to be written out, use write(OutputStream, boolean)
with preserveNodes
set to true
.
write
in class POIDocument
out
- The OutputStream to write to.java.io.IOException
- If there is an unexpected IOException from
the passed in OutputStreampublic void write(java.io.OutputStream out, boolean preserveNodes) throws java.io.IOException
preserveNodes
set to true
out
- The OutputStream to write to.preserveNodes
- Should all OLE2 streams be written back out, or only the common ones?java.io.IOException
- If there is an unexpected IOException from
the passed in OutputStreampublic EncryptionInfo getEncryptionInfo()
getEncryptionInfo
in class POIDocument
null
public int appendRootLevelRecord(Record newRecord)
public int addPicture(HSLFPictureData img)
public Record[] getRecords()
public byte[] getUnderlyingBytes()
public CurrentUserAtom getCurrentUserAtom()
public java.util.List<HSLFPictureData> getPictureData()
public HSLFObjectData[] getEmbeddedObjects()
public void close() throws java.io.IOException
POIDocument
POIFSFileSystem
from which
the document was read, if any. Has no effect on documents
opened from an InputStream, or newly created ones.
Once close()
has been called, no further operations
should be called on the document.
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class POIDocument
java.io.IOException
protected java.lang.String getEncryptedPropertyStreamName()
getEncryptedPropertyStreamName
in class POIDocument
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.