Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Documentation
Sidebar

Class FileManager

Hierarchy

java.lang.Object
     com.smartdevicelink.managers.BaseSubManager

Package
com.smartdevicelink.managers.file

Overview

FileManager
Note: This class must be accessed through the SdlManager. Do not instantiate it by itself.
The SDLFileManager uploads files and keeps track of all the uploaded files names during a session.
We need to add the following struct: SDLFile
It is broken down to these areas:
1. Getters
2. Deletion methods
3. Uploading Files / Artwork

Fields

Inherited Fields

From Class Fields
com.smartdevicelink.managers.BaseSubManager SETTING_UP, READY, LIMITED, SHUTDOWN, ERROR, internalInterface

Constructors

FileManager( ISdl internalInterface, Context context )

public FileManager(ISdl internalInterface,Context context)

Parameters

internalInterface
context

Methods

start( CompletionListener listener )

public void start(CompletionListener listener)

Parameters

listener

getRemoteFileNames()

Returns a list of file names currently residing on core

public java.util.List getRemoteFileNames()

deleteRemoteFileWithName( String fileName, CompletionListener listener )

Attempts to delete the desired file from core, calls listener with indication of success/failure

public void deleteRemoteFileWithName(String fileName,CompletionListener listener)

Parameters

fileName
name of file to be deleted
listener
callback that is called on response from core

deleteRemoteFilesWithNames( java.util.List<java.lang.String> fileNames, MultipleFileCompletionListener listener )

Attempts to delete a list of files from core, calls listener with indication of success/failure

public void deleteRemoteFilesWithNames(java.util.List<java.lang.String> fileNames,MultipleFileCompletionListener listener)

Parameters

fileNames
list of file names to be deleted
listener
callback that is called once core responds to all deletion requests

uploadFile( SdlFile file, CompletionListener listener )

Attempts to upload a SdlFile to core

public void uploadFile(SdlFile file,CompletionListener listener)

Parameters

file
SdlFile with file name and one of A) fileData, B) Uri, or C) resourceID set
listener
called when core responds to the attempt to upload the file

uploadFiles( java.util.List<? extends com.smartdevicelink.managers.file.filetypes.SdlFile> files, MultipleFileCompletionListener listener )

Attempts to upload a list of SdlFiles to core

public void uploadFiles(java.util.List<? extends com.smartdevicelink.managers.file.filetypes.SdlFile> files,MultipleFileCompletionListener listener)

Parameters

files
list of SdlFiles with file name and one of A) fileData, B) Uri, or C) resourceID set
listener
callback that is called once core responds to all upload requests

uploadArtwork( SdlArtwork file, CompletionListener listener )

Attempts to upload a SdlArtwork to core

public void uploadArtwork(SdlArtwork file,CompletionListener listener)

Parameters

file
SdlArtwork with file name and one of A) fileData, B) Uri, or C) resourceID set
listener
called when core responds to the attempt to upload the file

uploadArtworks( java.util.List<com.smartdevicelink.managers.file.filetypes.SdlArtwork> files, MultipleFileCompletionListener listener )

Attempts to upload a list of SdlArtworks to core

public void uploadArtworks(java.util.List<com.smartdevicelink.managers.file.filetypes.SdlArtwork> files,MultipleFileCompletionListener listener)

Parameters

files
list of SdlArtworks with file name and one of A) fileData, B) Uri, or C) resourceID set
listener
callback that is called once core responds to all upload requests

hasUploadedFile( SdlFile file )

Check if an SdlFile has been uploaded to core

public boolean hasUploadedFile(SdlFile file)

Parameters

file
SdlFile

buildErrorString( Result resultCode, String info )

Builds an error string for a given Result and info string

public static java.lang.String buildErrorString(Result resultCode,String info)

Parameters

resultCode
Result
info
String returned from OnRPCRequestListener.onError()

Inherited Methods

From Class Methods
com.smartdevicelink.managers.BaseSubManager start, dispose, transitionToState, getState, handleTransportUpdated, onTransportUpdate
java.lang.Object getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize
View on GitHub.com
Previous Section Next Section