Package com.inmobi.commons.core.storage
Object FileManager
-
- All Implemented Interfaces:
public class FileManagerThis is a utility class for the clearing the previous version files (or Dbs) on a SDK upgrade. While clearing the Dbs (if any required), if there is a failure then it tries to submit a telemetry event to be reported back if the Sdk has been initialized. If the Sdk has not been initialized properly, the report doesn't get submitted but there is no functionality loss.
-
-
Field Summary
Fields Modifier and Type Field Description public final static FileManagerINSTANCE
-
Method Summary
Modifier and Type Method Description final static BooleanclearFiles(Context context)Method to clear the cached files and db when there is sdk version update final static UnitdeleteDirectory(File path)final static LonggetFileSize(String fileLocationOnDevice)Method to get the size of file passed -
-
Method Detail
-
clearFiles
final static Boolean clearFiles(Context context)
Method to clear the cached files and db when there is sdk version update
- Parameters:
context- A context object to access the application methods- Returns:
falseif all old Dbs were cleared successfully,trueotherwise
-
deleteDirectory
final static Unit deleteDirectory(File path)
-
getFileSize
final static Long getFileSize(String fileLocationOnDevice)
Method to get the size of file passed
- Parameters:
fileLocationOnDevice- the actual path of file for which size needs to be calculated- Returns:
the file size(in Bytes) if it exists on the device, else returns 0.
-
-
-
-