public abstract class FormatBase extends Object implements com.aspose.ms.System.IDisposable
Represents base abstraction for supported file format.
Modifier and Type | Field and Description |
---|---|
protected String |
filePath
Represents absolute path to the file.
|
protected com.aspose.ms.System.IO.Stream |
stream
Represents file stream.
|
Modifier | Constructor and Description |
---|---|
protected |
FormatBase(InputStream input)
Initializes a new instance of the
FormatBase class. |
protected |
FormatBase(InputStream inputStream,
com.aspose.ms.System.Text.Encoding encoding)
Initializes a new instance of the
FormatBase class. |
protected |
FormatBase(String fileName)
Initializes a new instance of the
FormatBase class. |
protected |
FormatBase(String fileName,
com.aspose.ms.System.Text.Encoding encoding)
Initializes a new instance of the
FormatBase class. |
Modifier and Type | Method and Description |
---|---|
void |
cleanMetadata()
Removes (reset) metadata.
|
void |
dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
|
Metadata[] |
getMetadata()
Gets array of
Metadata contained in file. |
String |
getMIMEType()
Gets MIME type.
|
abstract int |
getType()
Gets document type.
|
MetadataProperty |
readByMetadataKey(MetadataKey key) |
void |
save()
Commits all changes.
|
void |
save(OutputStream outputStream)
Stores file content into stream.
|
void |
save(String outputPath)
Stores file content to the specific path.
|
protected String filePath
Represents absolute path to the file. Could be null.
protected com.aspose.ms.System.IO.Stream stream
Represents file stream.
protected FormatBase(String fileName, com.aspose.ms.System.Text.Encoding encoding)
Initializes a new instance of the FormatBase
class.
fileName
- Absolute path to the file.encoding
- The encoding of text metadata.protected FormatBase(String fileName)
Initializes a new instance of the FormatBase
class.
fileName
- Absolute path to the file.protected FormatBase(InputStream input)
Initializes a new instance of the FormatBase
class.
input
- File stream.protected FormatBase(InputStream inputStream, com.aspose.ms.System.Text.Encoding encoding)
Initializes a new instance of the FormatBase
class.
input
- File stream.encoding
- The encoding of text metadata.com.aspose.ms.System.ArgumentNullException
- File stream is not provided.public abstract int getType()
Gets document type.
Value: Document type.public final String getMIMEType()
Gets MIME type.
Value: The MIME type.public void cleanMetadata()
Removes (reset) metadata. In some cases(Doc, Xls, Ppt, Pdf) metadata could not be deleted, just be reset.
public final Metadata[] getMetadata()
Gets array of Metadata
contained in file.
Metadata
.public void save(OutputStream outputStream)
Stores file content into stream.
outputStream
- Output stream.com.aspose.ms.System.ArgumentNullException
- Output stream could not be null.public void save(String outputPath)
Stores file content to the specific path.
outputPath
- Output path.com.aspose.ms.System.ArgumentNullException
- Output path could not be null.com.aspose.ms.System.Exception
- Output path is already exists.public void save()
Commits all changes.
public final void dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
dispose
in interface com.aspose.ms.System.IDisposable
public MetadataProperty readByMetadataKey(MetadataKey key)
Copyright © 2017. All rights reserved.