public class FileManager extends BaseSubManager
ERROR, internalInterface, LIMITED, READY, SETTING_UP, SHUTDOWN| Constructor and Description |
|---|
FileManager(ISdl internalInterface,
Context context,
FileManagerConfig fileManagerConfig)
Constructor for FileManager
|
| Modifier and Type | Method and Description |
|---|---|
static String |
buildErrorString(Result resultCode,
String info)
Deprecated.
|
void |
deleteRemoteFilesWithNames(List<String> fileNames,
MultipleFileCompletionListener listener)
Attempts to delete a list of files from core, calls listener with indication of success/failure
|
void |
deleteRemoteFileWithName(String fileName,
CompletionListener listener)
Attempts to delete the desired file from core, calls listener with indication of success/failure
|
void |
dispose()
Called when manager is being torn down
|
boolean |
fileNeedsUpload(SdlFile file)
Check if an SdlFile needs to be uploaded to Core or not.
|
int |
getBytesAvailable()
Get the number of bytes still available for files for this app.
|
List<String> |
getRemoteFileNames()
Returns a list of file names currently residing on core
|
boolean |
hasUploadedFile(SdlFile file)
Check if an SdlFile has been uploaded to core
|
void |
start(CompletionListener listener)
Starts up a BaseSubManager, and calls provided callback once BaseSubManager is done setting up or failed setup.
|
void |
uploadArtwork(SdlArtwork file,
CompletionListener listener)
Attempts to upload a SdlArtwork to core
|
void |
uploadArtworks(List<SdlArtwork> files,
MultipleFileCompletionListener listener)
Attempts to upload a list of SdlArtworks to core
|
void |
uploadFile(SdlFile file,
CompletionListener listener)
Attempts to upload a SdlFile to core
|
void |
uploadFiles(List<? extends SdlFile> files,
MultipleFileCompletionListener listener)
Attempts to upload a list of SdlFiles to core
|
getState, handleTransportUpdated, onTransportUpdate, transitionToStatepublic FileManager(ISdl internalInterface, Context context, FileManagerConfig fileManagerConfig)
internalInterface - an instance of the ISdl interface that can be used for common SDL operations (sendRpc, addRpcListener, etc)context - an instances of Context interface to global information for applicationfileManagerConfig - an instance of the FileManagerConfig gives access to artworkRetryCount and fileRetryCount to let us if those file types can be re-upload if they failpublic void start(CompletionListener listener)
BaseSubManagerstart in class BaseSubManagerlistener - CompletionListener that is called once the BaseSubManager's state is READY, LIMITED, or ERRORpublic void dispose()
BaseSubManagerCalled when manager is being torn down
dispose in class BaseSubManagerpublic List<String> getRemoteFileNames()
public int getBytesAvailable()
public void deleteRemoteFileWithName(@NonNull
String fileName,
CompletionListener listener)
fileName - name of file to be deletedlistener - callback that is called on response from corepublic void deleteRemoteFilesWithNames(@NonNull
List<String> fileNames,
MultipleFileCompletionListener listener)
fileNames - list of file names to be deletedlistener - callback that is called once core responds to all deletion requestspublic boolean hasUploadedFile(@NonNull
SdlFile file)
file - SdlFilepublic boolean fileNeedsUpload(@NonNull
SdlFile file)
file - the SdlFile that needs to be checkedpublic void uploadFiles(@NonNull
List<? extends SdlFile> files,
MultipleFileCompletionListener listener)
files - list of SdlFiles with file name and one of A) fileData, B) Uri, or C) resourceID setlistener - callback that is called once core responds to all upload requestspublic void uploadFile(@NonNull
SdlFile file,
CompletionListener listener)
file - SdlFile with file name and one of A) fileData, B) Uri, or C) resourceID setlistener - called when core responds to the attempt to upload the filepublic void uploadArtwork(SdlArtwork file, CompletionListener listener)
file - SdlArtwork with file name and one of A) fileData, B) Uri, or C) resourceID setlistener - called when core responds to the attempt to upload the filepublic void uploadArtworks(List<SdlArtwork> files, MultipleFileCompletionListener listener)
files - list of SdlArtworks with file name and one of A) fileData, B) Uri, or C) resourceID setlistener - callback that is called once core responds to all upload requests@Deprecated public static String buildErrorString(Result resultCode, String info)
resultCode - Resultinfo - String returned from OnRPCRequestListener.onError()