Method Summary | ||
---|---|---|
static method | detectFileFormat(stream) | |
Detects and returns the information about a format of an excel stored in a stream.
|
||
static method | detectFileFormat(stream, password) | |
static method | detectFileFormat(filePath) | |
Detects and returns the information about a format of an excel stored in a file.
|
||
static method | detectFileFormat(filePath, password) | |
Detects and returns the information about a format of an excel stored in a file.
|
||
static method | detectFileFormatFromBytes(byte_array) | |
Detects and returns the information about a format of an excel stored in a byte array.
|
||
static method | extensionToSaveFormat(extension) | |
Converts a file name extension into a SaveFormat value.
|
||
static method | fileFormatToSaveFormat(format) | |
Converting file format to save format.
|
||
static method | isTemplateFormat(extension) | |
Returns true if the extension is .xlt, .xltX, .xltm,.ots.
|
||
static method | loadFormatToExtension(loadFormat) | |
Converts a load format enumerated value into a file extension.
|
||
static method | loadFormatToSaveFormat(loadFormat) | |
Converts a LoadFormat value to a SaveFormat value if possible.
|
||
static method | saveFormatToExtension(format) | |
Converts a save format enumerated value into a file extension.
|
||
static method | saveFormatToLoadFormat(saveFormat) | |
Converts a SaveFormat value to a LoadFormat value if possible.
|
||
static method | verifyPassword(stream, password) | |
Detects and returns the information about a format of an excel stored in a stream.
|
static FileFormatInfo detectFileFormat(stream)
stream: InputStream
- The streamstatic FileFormatInfo detectFileFormat(stream, password)
static boolean verifyPassword(stream, password)
stream: InputStream
- password: String
- The password for encrypted ooxml files.static FileFormatInfo detectFileFormat(filePath)
filePath: String
- The file path.static FileFormatInfo detectFileFormat(filePath, password)
filePath: String
- The file path.password: String
- The password for encrypted ooxml files.static int fileFormatToSaveFormat(format)
format: int
- A static int extensionToSaveFormat(extension)
extension: String
- The file extension. Can be with or without a leading dot. Case-insensitive.static boolean isTemplateFormat(extension)
extension: String
- static String loadFormatToExtension(loadFormat)
loadFormat: int
- A static int loadFormatToSaveFormat(loadFormat)
loadFormat: int
- A static String saveFormatToExtension(format)
format: int
- A static int saveFormatToLoadFormat(saveFormat)
saveFormat: int
- A static detectFileFormatFromBytes(byte_array)
byte_array: bytes
- The byte arrayExample:
import jpype import asposecells jpype.startJVM() from asposecells.api import * with open('Book2.xlsx', 'rb') as f: result = FileFormatUtil.detectFileFormatFromBytes(f.read()) print("detect result: %d" %(result.getFileFormatType())) jpype.shutdownJVM()