public final class XlsFormat extends DocumentFormat<XlsMetadata,XlsMetadataProperty,DocumentInfo> implements IProtectableFormat, IInspectable<XlsInspectionResult,XlsInspectionOptions>, ISignedFormat
Represents Excel format.
Constructor and Description |
---|
XlsFormat(InputStream input)
Initializes a new instance of the
XlsFormat class. |
XlsFormat(InputStream input,
LoadOptions loadOptions)
Initializes a new instance of the
XlsFormat class. |
XlsFormat(String fileName)
Initializes a new instance of the
XlsFormat class. |
XlsFormat(String fileName,
LoadOptions loadOptions)
Initializes a new instance of the
XlsFormat class. |
Modifier and Type | Method and Description |
---|---|
void |
addContentTypeProperties(XlsContentProperty[] properties)
Adds the content type properties.
|
void |
addContentTypeProperty(XlsContentProperty property)
Adds the content type property.
|
void |
cleanMetadata()
Removes (reset) metadata.
|
void |
clearContentTypeProperties()
Removes all content type properties.
|
void |
clearCustomProperties()
Removes all custom document properties in
XlsFormat . |
protected void |
dispose(boolean disposing)
Releases unmanaged and optionally managed resources.
|
XlsMetadata |
getDocumentProperties()
Gets the document properties in
XlsFormat . |
int |
getFileType()
Gets the file type like XLSX, XlSX etc.
|
int |
getType()
Gets document type.
|
boolean |
hasDigitalSignatures()
Gets
true if document contains DigitalSignature . |
XlsInspectionResult |
inspectDocument()
Inspects the document and returns comments and hidden sheets.
|
boolean |
isProtected()
Returns true if the document is encrypted and requires a password to open.
|
void |
removeHiddenData(XlsInspectionOptions options)
Removes the hidden data.
|
clearBuiltInProperties, extractDocumentProperties, getDocumentInfo, getThumbnail, readDocumentPropertyByKey, readPropertyByName, readThumbnail, setProperties
close, dispose, getMetadata, getMIMEType, readByMetadataKey, save, save, save
public XlsFormat(String fileName)
Initializes a new instance of the XlsFormat
class.
fileName
- The absolute path to the file.public XlsFormat(String fileName, LoadOptions loadOptions)
Initializes a new instance of the XlsFormat
class.
fileName
- The absolute path to the file.loadOptions
- Additional options to use when loading the document.public XlsFormat(InputStream input)
Initializes a new instance of the XlsFormat
class.
input
- The stream containing the file.public XlsFormat(InputStream input, LoadOptions loadOptions)
Initializes a new instance of the XlsFormat
class.
input
- The stream containing the file.loadOptions
- Additional options to use when loading the document.public int getType()
Gets document type.
getType
in class FormatBase
public XlsMetadata getDocumentProperties()
Gets the document properties in XlsFormat
.
getDocumentProperties
in class DocumentFormat<XlsMetadata,XlsMetadataProperty,DocumentInfo>
public int getFileType()
Gets the file type like XLSX, XlSX etc.
getFileType
in class DocumentFormat<XlsMetadata,XlsMetadataProperty,DocumentInfo>
public final boolean isProtected()
Returns true if the document is encrypted and requires a password to open.
isProtected
in interface IProtectableFormat
true
if document is protected; otherwise, false
.public final boolean hasDigitalSignatures()
Gets true
if document contains DigitalSignature
.
hasDigitalSignatures
in interface ISignedFormat
true
if document has digital signatures; otherwise, false
.GroupDocsException
- Could not read digital signatures.
Value:
true
if document has digital signatures; otherwise, false
.public void cleanMetadata()
Removes (reset) metadata. In some cases(Doc, Xls, Ppt, Pdf) metadata could not be deleted.
cleanMetadata
in class FormatBase
public void clearCustomProperties()
Removes all custom document properties in XlsFormat
.
clearCustomProperties
in class DocumentFormat<XlsMetadata,XlsMetadataProperty,DocumentInfo>
public final void addContentTypeProperties(XlsContentProperty[] properties)
Adds the content type properties.
properties
- Array of properties.
ArgumentNullException
- Properties could not be null.public final void addContentTypeProperty(XlsContentProperty property)
Adds the content type property.
property
- Content type property.
ArgumentNullException
- Property could not be null.public final void clearContentTypeProperties()
Removes all content type properties. Not supported in ODS format.
public final XlsInspectionResult inspectDocument()
Inspects the document and returns comments and hidden sheets.
inspectDocument
in interface IInspectable<XlsInspectionResult,XlsInspectionOptions>
XlsInspectionResult
.public final void removeHiddenData(XlsInspectionOptions options)
Removes the hidden data.
removeHiddenData
in interface IInspectable<XlsInspectionResult,XlsInspectionOptions>
options
- The inspection options.ArgumentNullException
- Options could not be null.protected void dispose(boolean disposing)
Releases unmanaged and optionally managed resources.
dispose
in class FormatBase
disposing
- true
to release both managed and unmanaged resources;
false
to release only unmanaged resources.Copyright © 2019. All rights reserved.