java.lang.Object | |
↳ | com.tencent.wcdb.repair.RecoverKit |
Data recovery toolkit that recover data backed up by BackupKit
.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | RESULT_CANCELED | Result code that indicates operation has been cancelled. | |||||||||
int | RESULT_FAILED | Result code that indicates operation failure. | |||||||||
int | RESULT_OK | Result code that indicates successful operation. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
RecoverKit(SQLiteDatabase db, String inPath, byte[] key)
Create and initialize a recovery task.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
cancel()
Cancel the current running recovery operation.
| ||||||||||
int |
failureCount()
Retrieve total count of statements had been failed during the last time
run(boolean) was called. | ||||||||||
String |
lastError()
Get the last error message.
| ||||||||||
void |
release()
Cleanup and release this recovery task.
| ||||||||||
int |
run(boolean fatal)
Run recovery task.
| ||||||||||
int |
successCount()
Retrieve total count of successful statements had been run during the last time
run(boolean) was called. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Result code that indicates operation has been cancelled.
Result code that indicates operation failure.
Result code that indicates successful operation.
Create and initialize a recovery task.
db | database where recovered data is written |
---|---|
inPath | path to the backup file |
key | key to the encrypted backup file, or null for plain-text backup file. |
SQLiteException | when backup file cannot be opened. |
---|
Cancel the current running recovery operation.
This method can be called on threads other than the one called run(boolean)
Calling this method causes run(boolean)
to interrupt as quickly as possible and
return RESULT_CANCELED
Retrieve total count of statements had been failed during the last time
run(boolean)
was called.
Get the last error message.
Cleanup and release this recovery task. No further operations should be done on this object after calling it.
Run recovery task.
Note: this method will not return until recovery is finished or cancelled. Do not call this method directly on the main thread or it will probably cause ANR.
fatal | whether or not to treat errors as fatal. When it's true and an error occurs,
recovery will end and return RESULT_CANCELED . |
---|
RESULT_OK
, RESULT_CANCELED
or
RESULT_FAILED
.
Retrieve total count of successful statements had been run during the last time
run(boolean)
was called.