java.lang.Object
com.aspose.cells.FileFormatUtil
public class FileFormatUtil
- extends java.lang.Object
Provides utility methods for converting file format enums to strings or file extensions and back.
Method Summary |
static FileFormatInfo | detectFileFormat(java.io.InputStream stream) | |
Detects and returns the information about a format of an excel stored in a stream.
|
static FileFormatInfo | detectFileFormat(java.io.InputStream stream, java.lang.String password) | |
Detects and returns the information about a format of an excel stored in a stream.
|
static FileFormatInfo | detectFileFormat(java.lang.String filePath) | |
Detects and returns the information about a format of an excel stored in a file.
|
static FileFormatInfo | detectFileFormat(java.lang.String filePath, java.lang.String password) | |
Detects and returns the information about a format of an excel stored in a file.
|
static int | extensionToSaveFormat(java.lang.String extension) | |
Converts a file name extension into a SaveFormat value.
|
static int | fileFormatToSaveFormat(int format) | |
Converting file format to save format.
|
static boolean | isTemplateFormat(java.lang.String extension) | |
Returns true if the extension is .xlt, .xltX, .xltm,.ots.
|
static java.lang.String | loadFormatToExtension(int loadFormat) | |
Converts a load format enumerated value into a file extension.
|
static int | loadFormatToSaveFormat(int loadFormat) | |
Converts a LoadFormat value to a SaveFormat value if possible.
|
static java.lang.String | saveFormatToExtension(int format) | |
Converts a save format enumerated value into a file extension.
|
static int | saveFormatToLoadFormat(int saveFormat) | |
Converts a SaveFormat value to a LoadFormat value if possible.
|
static boolean | verifyPassword(java.io.InputStream stream, java.lang.String password) | |
Detects and returns the information about a format of an excel stored in a stream.
|
detectFileFormat | |
public static FileFormatInfo detectFileFormat(java.io.InputStream stream)
throws java.lang.Exception |
-
Detects and returns the information about a format of an excel stored in a stream.
- Parameters:
stream
- The stream
- Returns:
- A FileFormatInfo object that contains the detected information.
detectFileFormat | |
public static FileFormatInfo detectFileFormat(java.io.InputStream stream, java.lang.String password)
throws java.lang.Exception |
-
Detects and returns the information about a format of an excel stored in a stream.
- Parameters:
stream
- password
- The password for encrypted ooxml files.
- Returns:
- A FileFormatInfo object that contains the detected information.
verifyPassword | |
public static boolean verifyPassword(java.io.InputStream stream, java.lang.String password)
throws java.lang.Exception |
-
Detects and returns the information about a format of an excel stored in a stream.
- Parameters:
stream
- password
- The password for encrypted ooxml files.
- Returns:
- Returns whether the password is corrected.
detectFileFormat | |
public static FileFormatInfo detectFileFormat(java.lang.String filePath)
throws java.lang.Exception |
-
Detects and returns the information about a format of an excel stored in a file.
- Parameters:
filePath
- The file path.
- Returns:
- A FileFormatInfo object that contains the detected information.
detectFileFormat | |
public static FileFormatInfo detectFileFormat(java.lang.String filePath, java.lang.String password)
throws java.lang.Exception |
-
Detects and returns the information about a format of an excel stored in a file.
- Parameters:
filePath
- The file path.password
- The password for encrypted ooxml files.
- Returns:
- A FileFormatInfo object that contains the detected information.
fileFormatToSaveFormat | |
public static int fileFormatToSaveFormat(int format) |
-
Converting file format to save format.
- Parameters:
format
- A FileFormatType value. The file format type.
- Returns:
- A SaveFormat value.
extensionToSaveFormat | |
public static int extensionToSaveFormat(java.lang.String extension) |
-
Converts a file name extension into a SaveFormat value.
If the extension cannot be recognized, returns SaveFormat.UNKNOWN.
- Parameters:
extension
- The file extension. Can be with or without a leading dot. Case-insensitive.
- Returns:
- A SaveFormat value.
isTemplateFormat | |
public static boolean isTemplateFormat(java.lang.String extension) |
-
Returns true if the extension is .xlt, .xltX, .xltm,.ots.
- Parameters:
extension
-
- Returns:
loadFormatToExtension | |
public static java.lang.String loadFormatToExtension(int loadFormat) |
-
Converts a load format enumerated value into a file extension.
If it can not be converted, returns null.
- Parameters:
loadFormat
- A LoadFormat value. The loaded file format.
- Returns:
- The returned extension is a lower-case string with a leading dot.
loadFormatToSaveFormat | |
public static int loadFormatToSaveFormat(int loadFormat) |
-
Converts a LoadFormat value to a SaveFormat value if possible.
- Parameters:
loadFormat
- A LoadFormat value. The load format.
- Returns:
- A SaveFormat value. The save format.
saveFormatToExtension | |
public static java.lang.String saveFormatToExtension(int format) |
-
Converts a save format enumerated value into a file extension.
- Parameters:
format
- A SaveFormat value. The save format.
- Returns:
- The returned extension is a lower-case string with a leading dot.
saveFormatToLoadFormat | |
public static int saveFormatToLoadFormat(int saveFormat) |
-
Converts a SaveFormat value to a LoadFormat value if possible.
- Parameters:
saveFormat
- A SaveFormat value. The save format.
- Returns:
- A LoadFormat value. The load format
See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.