public final class PresentationInfo extends java.lang.Object implements IPresentationInfo
Information about presentation file
Modifier and Type | Method and Description |
---|---|
boolean |
checkPassword(java.lang.String password)
Checks whether a password is correct for a presentation protected with open password.
|
boolean |
checkWriteProtection(java.lang.String password)
Checks whether a password to modify is correct for a write protected presentation.
|
int |
getLoadFormat()
Gets format of the binded presentation.
|
boolean |
isEncrypted()
Gets True if binded presentation is encrypted, otherwise False.
|
boolean |
isPasswordProtected()
Gets a value that indicates whether a binded presentation is protected by a password to open.
|
byte |
isWriteProtected()
Gets a value that indicates whether a binded presentation is write protected.
|
IDocumentProperties |
readDocumentProperties()
Gets document properties of binded presentation.
|
void |
updateDocumentProperties(IDocumentProperties documentProperties)
Updates properties of binded presentation.
|
void |
writeBindedPresentation(java.io.OutputStream stream)
Writes binded presentation to stream.
|
void |
writeBindedPresentation(java.lang.String file)
Writes binded presentation to file.
|
public final boolean isEncrypted()
Gets True if binded presentation is encrypted, otherwise False.
Read-only boolean
.
isEncrypted
in interface IPresentationInfo
public final boolean isPasswordProtected()
Gets a value that indicates whether a binded presentation is protected by a password to open.
IPresentationInfo info = PresentationFactory.getInstance().getPresentationInfo(presentationFilePath); if (info.isPasswordProtected()) { System.out.println("The presentation '" + presentationFilePath + "' is protected by password to open."); }
isPasswordProtected
in interface IPresentationInfo
public final byte isWriteProtected()
Gets a value that indicates whether a binded presentation is write protected.
IPresentationInfo info = PresentationFactory.getInstance().getPresentationInfo(presentationFilePath); if (info.isWriteProtected() == NullableBool.True) { System.out.println("The presentation '" + presentationFilePath + "' is protected by password to open."); }
isWriteProtected
in interface IPresentationInfo
public final int getLoadFormat()
Gets format of the binded presentation.
Read-only LoadFormat
.
getLoadFormat
in interface IPresentationInfo
public final boolean checkPassword(java.lang.String password)
Checks whether a password is correct for a presentation protected with open password.
IPresentationInfo info = PresentationFactory.getInstance().getPresentationInfo(presentationFilePath); boolean isPasswordCorrect = info.checkPassword("my_password");
checkPassword
in interface IPresentationInfo
password
- The password to check.
com.aspose.ms.System.InvalidOperationException
- if an unknown presentation format is encountered.com.aspose.ms.System.NotSupportedException
- if format is not supported to check passwords.public final boolean checkWriteProtection(java.lang.String password)
Checks whether a password to modify is correct for a write protected presentation.
IPresentationInfo info = PresentationFactory.getInstance().getPresentationInfo(presentationFilePath); if (info.isWriteProtected() == NullableBool.True) { boolean isWriteProtectedByPassword = info.checkWriteProtection("my_password"); }
checkWriteProtection
in interface IPresentationInfo
password
- The password to check.
IsWriteProtected
(isWriteProtected()
) property before calling this method.
2. When password is null or empty, this method returns false.
com.aspose.ms.System.InvalidOperationException
- If a presentation is protected by a password to open or format does not support write protectionpublic final IDocumentProperties readDocumentProperties()
Gets document properties of binded presentation.
readDocumentProperties
in interface IPresentationInfo
IDocumentProperties
public final void updateDocumentProperties(IDocumentProperties documentProperties)
Updates properties of binded presentation.
This sample shows how to call theupdateDocumentProperties(IDocumentProperties)
method to update the document properties returned by call of thereadDocumentProperties()
method.IPresentationInfo info = PresentationFactory.getInstance().getPresentationInfo("pres.pptx"); IDocumentProperties props = info.readDocumentProperties(); props.setSubject("New subject"); props.setLastSavedTime(Calendar.getInstance().getTime()); info.updateDocumentProperties(props); info.writeBindedPresentation("new_pres.pptx");
updateDocumentProperties
in interface IPresentationInfo
documentProperties
- Document properties IDocumentProperties
public final void writeBindedPresentation(java.io.OutputStream stream)
Writes binded presentation to stream.
writeBindedPresentation
in interface IPresentationInfo
stream
- The stream must be seekable and writable.public final void writeBindedPresentation(java.lang.String file)
Writes binded presentation to file.
writeBindedPresentation
in interface IPresentationInfo
file
- Presentation file.