public class SpenSDocFile extends Object
| Constructor and Description |
|---|
SpenSDocFile() |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkValidity(String sdocFilePath)
Check a validity of SDoc file to open.
|
static boolean |
deleteCacheDirectory(Context context,
String fileFullPath)
Delete cache directory
|
static long |
getCreatedTime(String sdocFilePath)
Get a created time of SDoc document.
|
static long |
getCreatedTime(String sdocFilePath,
boolean checkUnsupportedVersionException)
Get a created time of SDoc document.
|
static int |
getDocumentType(String sdocFilePath)
Get a document type.
|
static int |
getFormatVersion(String sdocFilePath)
Get a file format version of SDoc
|
static long |
getModifiedTime(String sdocFilePath)
Get a last modified time of SDoc document.
|
static long |
getModifiedTime(String sdocFilePath,
boolean checkUnsupportedVersionException)
Get a last modified time of SDoc document.
|
static String |
getTitle(String sdocFilePath)
Get a title
|
static String |
getTitle(String sdocFilePath,
boolean checkUnsupportedVersionException)
Get a title
|
static long |
getUncompressedSize(String sdocFilePath)
Get an uncompressed size of SDoc
|
static boolean |
hasUnsavedData(Context context,
String fileFullPath)
Check has unsaved data.
|
static boolean |
isFavorite(String sdocFilePath)
Check the SDoc document is set favorite or not
|
static boolean |
isLocked(String sdocFilePath)
Check the file is locked or not.
|
static void |
lock(String filePath,
String password)
Lock the SDoc.
|
static void |
setFavorite(String sdocFilePath,
boolean flag)
Set the favorite of SDoc document
|
static void |
unlock(String filePath,
String password)
Unlock the SDoc.
|
public static long getModifiedTime(String sdocFilePath) throws IOException, SpenSDocUnsupportedFileException, SpenSDocUnsupportedVersionException
sdocFilePath - The absolute path of the file.IOException - Thrown if the file is not found.IllegalArgumentException - Thrown if sdocFilePath is null.SpenSDocUnsupportedFileException - Thrown if the file is not in SDoc file format.SpenSDocUnsupportedVersionException - Thrown if the version if SDoc file is not supported.public static long getModifiedTime(String sdocFilePath, boolean checkUnsupportedVersionException) throws IOException, SpenSDocUnsupportedFileException, SpenSDocUnsupportedVersionException
sdocFilePath - The absolute path of the file.checkUnsupportedVersionException - If true, do not throw SpenSDocUnsupportedVersionException.IOException - Thrown if the file is not found.IllegalArgumentException - Thrown if sdocFilePath is null.SpenSDocUnsupportedFileException - Thrown if the file is not in SDoc file format.SpenSDocUnsupportedVersionException - Thrown if the version if SDoc file is not supported.public static long getCreatedTime(String sdocFilePath) throws IOException, SpenSDocUnsupportedFileException, SpenSDocUnsupportedVersionException
sdocFilePath - The absolute path of the file.IOException - Thrown if the file is not found.IllegalArgumentException - Thrown if sdocFilePath is null.SpenSDocUnsupportedFileException - Thrown if the file is not in SDoc file format.SpenSDocUnsupportedVersionException - Thrown if the version if SDoc file is not supported.public static long getCreatedTime(String sdocFilePath, boolean checkUnsupportedVersionException) throws IOException, SpenSDocUnsupportedFileException, SpenSDocUnsupportedVersionException
sdocFilePath - The absolute path of the file.checkUnsupportedVersionException - If true, do not throw SpenSDocUnsupportedVersionException.IOException - Thrown if the file is not found.IllegalArgumentException - Thrown if sdocFilePath is null.SpenSDocUnsupportedFileException - Thrown if the file is not in SDoc file format.SpenSDocUnsupportedVersionException - Thrown if the version if SDoc file is not supported.public static void checkValidity(String sdocFilePath) throws IOException, SpenSDocUnsupportedFileException, SpenSDocUnsupportedVersionException
sdocFilePath - The absolute path of the file.IOException - Thrown if the file is not found.IllegalArgumentException - Thrown if sdocFilePath is null.SpenSDocUnsupportedFileException - Thrown if the file is not in SDoc file format.SpenSDocUnsupportedVersionException - Thrown if the version if SDoc file is not supported.public static void lock(String filePath, String password) throws IOException, SpenSDocUnsupportedFileException, SpenSDocUnsupportedVersionException
filePath - The absolute path of the file.password - The password for a protected file.IOException - Thrown if the file is not found.IllegalArgumentException - Thrown if sdocFilePath is null.password is null.SpenSDocUnsupportedFileException - Thrown if the file is not in SDoc file format.SpenSDocUnsupportedVersionException - Thrown if the version if SDoc file is not supported.public static void unlock(String filePath, String password) throws IOException, SpenSDocUnsupportedFileException, SpenSDocUnsupportedVersionException, SpenSDocInvalidPasswordException
filePath - The absolute path of the file.password - The password for a protected file.IOException - Thrown if the file is not found.IllegalArgumentException - Thrown if sdocFilePath is null.SpenSDocUnsupportedFileException - Thrown if the file is not in SDoc file format.SpenSDocUnsupportedVersionException - Thrown if the version if SDoc file is not supported.SpenSDocInvalidPasswordException - Thrown if the password is invalid.public static boolean isLocked(String sdocFilePath)
sdocFilePath - The absolute path of the file.public static boolean hasUnsavedData(Context context, String fileFullPath)
context - The Context for your application.fileFullPath - The absolute path of the file.NullPointerException - Thrown if the context is null.public static int getDocumentType(String sdocFilePath) throws IOException, SpenSDocUnsupportedFileException, SpenSDocUnsupportedVersionException
sdocFilePath - The absolute path of the file.IOException - Thrown if the file is not found.IllegalArgumentException - Thrown if sdocFilePath is null.SpenSDocUnsupportedFileException - Thrown if the file is not in SDoc file format.SpenSDocUnsupportedVersionException - Thrown if the version if SDoc file is not supported.public static String getTitle(String sdocFilePath) throws IOException, SpenSDocUnsupportedFileException, SpenSDocUnsupportedVersionException
sdocFilePath - The absolute path of the file.IOException - Thrown if the file is not found.IllegalArgumentException - Thrown if sdocFilePath is null.SpenSDocUnsupportedFileException - Thrown if the file is not in SDoc file format.SpenSDocUnsupportedVersionException - Thrown if the version if SDoc file is not supported.public static String getTitle(String sdocFilePath, boolean checkUnsupportedVersionException) throws IOException, SpenSDocUnsupportedFileException, SpenSDocUnsupportedVersionException
sdocFilePath - The absolute path of the file.checkUnsupportedVersionException - If true, do not throw SpenSDocUnsupportedVersionException.IOException - Thrown if the file is not found.IllegalArgumentException - Thrown if sdocFilePath is null.SpenSDocUnsupportedFileException - Thrown if the file is not in SDoc file format.SpenSDocUnsupportedVersionException - Thrown if the version if SDoc file is not supported.public static void setFavorite(String sdocFilePath, boolean flag) throws IOException, SpenSDocUnsupportedFileException, SpenSDocUnsupportedVersionException
sdocFilePath - The absolute path of the file.flag - If true, set favorite flag.IOException - Thrown if the file is not found.IllegalArgumentException - Thrown if sdocFilePath is null.SpenSDocUnsupportedFileException - Thrown if the file is not in SDoc file format.SpenSDocUnsupportedVersionException - Thrown if the version if SDoc file is not supported.public static boolean isFavorite(String sdocFilePath)
sdocFilePath - The absolute path of the file.public static int getFormatVersion(String sdocFilePath) throws IOException, SpenSDocUnsupportedFileException, SpenSDocUnsupportedVersionException
sdocFilePath - The absolute path of the file.IOException - Thrown if the file is not found.IllegalArgumentException - Thrown if sdocFilePath is null.SpenSDocUnsupportedFileException - Thrown if the file is not in SDoc file format.SpenSDocUnsupportedVersionException - Thrown if the version if SDoc file is not supported.public static long getUncompressedSize(String sdocFilePath) throws IOException, SpenSDocUnsupportedFileException, SpenSDocUnsupportedVersionException
sdocFilePath - The absolute path of the file.IOException - Thrown if the file is not found.IllegalArgumentException - Thrown if sdocFilePath is null.SpenSDocUnsupportedFileException - Thrown if the file is not in SDoc file format.SpenSDocUnsupportedVersionException - Thrown if the version if SDoc file is not supported.public static boolean deleteCacheDirectory(Context context, String fileFullPath) throws IOException
context - The Context for your application.fileFullPath - The absolute path of the file.NullPointerException - Thrown if context is null.IOException - Thrown if the file is not found.