public class SdlFile extends Object implements Cloneable
| Constructor and Description |
|---|
SdlFile()
Creates a new instance of SdlFile
|
SdlFile(StaticIconName staticIconName)
Creates a new instance of SdlFile
|
SdlFile(String fileName,
FileType fileType,
byte[] data,
boolean persistentFile)
Creates a new instance of SdlFile
|
SdlFile(String fileName,
FileType fileType,
int id,
boolean persistentFile)
Creates a new instance of SdlFile
|
SdlFile(String fileName,
FileType fileType,
Uri uri,
boolean persistentFile)
Creates a new instance of SdlFile
|
| Modifier and Type | Method and Description |
|---|---|
SdlFile |
clone()
Creates a deep copy of the object
|
boolean |
equals(Object o)
Uses our custom hashCode for SdlFile objects
|
byte[] |
getFileData()
Gets the byte array that represents the content of the file
|
String |
getName()
Gets the name of the file
|
boolean |
getOverwrite()
Gets the overwrite property for an SdlFile by default its set to false
|
int |
getResourceId()
Gets the resource id of the file
|
FileType |
getType()
Gets the type of the file
|
Uri |
getUri()
Gets the uri of the file
|
int |
hashCode()
Used to compile hashcode for SdlFile for use to compare in overridden equals method
|
boolean |
isPersistent()
Gets whether the file should persist between sessions / ignition cycles
|
boolean |
isStaticIcon()
Gets the the name of the static file.
|
void |
setFileData(byte[] data)
Sets the byte array that represents the content of the file
|
void |
setName(String fileName)
Sets the name of the file
|
void |
setOverwrite(boolean overwrite)
Sets the overwrite property for an SdlFile by default its set to false
|
void |
setPersistent(boolean persistentFile)
Sets whether the file should persist between sessions / ignition cycles
|
void |
setResourceId(int id)
Sets the resource ID of the file
|
void |
setStaticIcon(boolean staticIcon)
Sets the the name of the static file.
|
void |
setType(FileType fileType)
Sets the type of the file
|
void |
setUri(Uri uri)
Sets the uri of the file
|
public SdlFile()
public SdlFile(String fileName, @NonNull FileType fileType, int id, boolean persistentFile)
fileName - a String value representing the name that will be used to store the file in the head unit. You can pass null if you want the library to auto generate the namefileType - a FileType enum value representing the type of the fileid - an int value representing the android resource id of the filepersistentFile - a boolean value that indicates if the file is meant to persist between sessions / ignition cyclespublic SdlFile(String fileName, @NonNull FileType fileType, Uri uri, boolean persistentFile)
fileName - a String value representing the name that will be used to store the file in the head unit. You can pass null if you want the library to auto generate the namefileType - a FileType enum value representing the type of the fileuri - a URI value representing a file's location. Currently, it only supports local filespersistentFile - a boolean value that indicates if the file is meant to persist between sessions / ignition cyclespublic SdlFile(String fileName, @NonNull FileType fileType, byte[] data, boolean persistentFile)
fileName - a String value representing the name that will be used to store the file in the head unit. You can pass null if you want the library to auto generate the namefileType - a FileType enum value representing the type of the filedata - a byte array representing the data of the filepersistentFile - a boolean value that indicates if the file is meant to persist between sessions / ignition cyclespublic SdlFile(@NonNull
StaticIconName staticIconName)
staticIconName - a StaticIconName enum value representing the name of a static file that comes pre-shipped with the head unitpublic void setName(String fileName)
fileName - a String value representing the name that will be used to store the file in the head unit. You can pass null if you want the library to auto generate the namepublic String getName()
public void setResourceId(int id)
id - an int value representing the android resource id of the filepublic int getResourceId()
public void setUri(Uri uri)
uri - a URI value representing a file's location. Currently, it only supports local filespublic Uri getUri()
public void setFileData(byte[] data)
data - a byte array representing the data of the filepublic byte[] getFileData()
public void setType(@NonNull
FileType fileType)
fileType - a FileType enum value representing the type of the filepublic FileType getType()
public void setPersistent(boolean persistentFile)
persistentFile - a boolean value that indicates if the file is meant to persist between sessions / ignition cyclespublic boolean isPersistent()
public void setStaticIcon(boolean staticIcon)
staticIcon - a StaticIconName enum value representing the name of a static file that comes pre-shipped with the head unitpublic boolean isStaticIcon()
public boolean getOverwrite()
public void setOverwrite(boolean overwrite)
overwrite - a boolean value that indicates if a file can be overwrittenpublic int hashCode()
public boolean equals(Object o)