com.ooyala.android.util.TemporaryInternalStorageFileManager Class Reference

Help create and cleanup automatically uniquely named files in the given Context's internal cache directory. More...

Public Member Functions

TemporaryInternalStorageFile next (final Context context, final String prefix, final String ext) throws IOException
 The final name of the file inside the returned TemporaryInternalStorageFile will include the given prefix and ext, but will be concatentated with other strings to make it unique vs. More...
 
void cleanup (final Context context)
 Remove any temporary files that (1) match our managed file name structure and (2) are too old. More...
 

Static Public Attributes

static final long TMP_LIFESPAN_MSEC = 5 * 60 * 1000
 

Detailed Description

Help create and cleanup automatically uniquely named files in the given Context's internal cache directory.

The first use case was for Analytics.java javascript loading, where we do not have a good way of knowing when it is safe to delete files so we use a window of time for reaping.

Member Function Documentation

void com.ooyala.android.util.TemporaryInternalStorageFileManager.cleanup ( final Context  context)

Remove any temporary files that (1) match our managed file name structure and (2) are too old.

TemporaryInternalStorageFile com.ooyala.android.util.TemporaryInternalStorageFileManager.next ( final Context  context,
final String  prefix,
final String  ext 
) throws IOException

The final name of the file inside the returned TemporaryInternalStorageFile will include the given prefix and ext, but will be concatentated with other strings to make it unique vs.

any other TemporaryInternalStorageFile created via this call. If somebody creates a TemporaryInternalStorageFile without going through here then collisions are possible.

Member Data Documentation

final long com.ooyala.android.util.TemporaryInternalStorageFileManager.TMP_LIFESPAN_MSEC = 5 * 60 * 1000
static