java.lang.Objectcom.aspose.words.FileFormatUtil
public abstract class FileFormatUtil
Method Summary | ||
---|---|---|
static int | contentTypeToLoadFormat(java.lang.String contentType) | |
Converts IANA content type into a load format enumerated value. | ||
static int | contentTypeToSaveFormat(java.lang.String contentType) | |
Converts IANA content type into a save format enumerated value. | ||
static FileFormatInfo | detectFileFormat(java.io.InputStream stream) | |
Detects and returns the information about a format of a document stored in a stream. | ||
static FileFormatInfo | detectFileFormat(java.lang.String fileName) | |
Detects and returns the information about a format of a document stored in a disk file. | ||
static int | extensionToSaveFormat(java.lang.String extension) | |
Converts a file name extension into a |
||
static java.lang.String | imageTypeToExtension(int imageType) | |
Converts an Aspose.Words image type enumerated value into a file extension. The returned extension is a lower-case string with a leading dot. | ||
static java.lang.String | loadFormatToExtension(int loadFormat) | |
Converts a load format enumerated value into a file extension. The returned extension is a lower-case string with a leading dot. | ||
static int | loadFormatToSaveFormat(int loadFormat) | |
Converts a |
||
static java.lang.String | saveFormatToExtension(int saveFormat) | |
Converts a save format enumerated value into a file extension. The returned extension is a lower-case string with a leading dot. | ||
static int | saveFormatToLoadFormat(int saveFormat) | |
Converts a |
Method Detail |
---|
contentTypeToLoadFormat | |
public static int contentTypeToLoadFormat(java.lang.String contentType) |
contentTypeToSaveFormat | |
public static int contentTypeToSaveFormat(java.lang.String contentType) |
detectFileFormat | |
public static FileFormatInfo detectFileFormat(java.io.InputStream stream) throws java.lang.Exception |
The stream must be positioned at the beginning of the document.
Detecting a file format might require seeking to various positions in the stream. Because java.io.InputStream is not seekable, this method loads the whole stream into memory temporarily. When this method returns, the stream is positioned at the end of the document.
Even if this method detects the document format, it does not guarantee
that the specified document is valid. This method only detects the document format by
reading data that is sufficient for detection. To fully verify that a document is valid
you need to load the document into a
This method throws
stream
- The stream.detectFileFormat | |
public static FileFormatInfo detectFileFormat(java.lang.String fileName) throws java.lang.Exception |
Even if this method detects the document format, it does not guarantee
that the specified document is valid. This method only detects the document format by
reading data that is sufficient for detection. To fully verify that a document is valid
you need to load the document into a
This method throws
fileName
- The file name.extensionToSaveFormat | |
public static int extensionToSaveFormat(java.lang.String extension) |
If the extension cannot be recognized, returns
extension
- The file extension. Can be with or without a leading dot. Case-insensitive.imageTypeToExtension | |
public static java.lang.String imageTypeToExtension(int imageType) |
imageType
- A ImageType value.loadFormatToExtension | |
public static java.lang.String loadFormatToExtension(int loadFormat) |
The
loadFormat
- A LoadFormat value.loadFormatToSaveFormat | |
public static int loadFormatToSaveFormat(int loadFormat) |
loadFormat
- A LoadFormat value.saveFormatToExtension | |
public static java.lang.String saveFormatToExtension(int saveFormat) |
The
The
saveFormat
- A SaveFormat value.saveFormatToLoadFormat | |
public static int saveFormatToLoadFormat(int saveFormat) |
saveFormat
- A SaveFormat value.