Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Internet Explorer alert
This browser is not recommended for use with smartdevicelink.com, and may not function properly. Upgrade to a different browser to guarantee support of all features.
close alert
To Top Created with Sketch. To Top
To Bottom Created with Sketch. To Bottom
Android Documentation
SdlFile

Class SdlFile

Hierarchy

java.lang.Object

Package
com.smartdevicelink.managers.file.filetypes
All Implemented Interfaces
java.lang.Cloneable
All Known Subclasses
com.smartdevicelink.managers.file.filetypes.SdlArtwork

Overview

A class representing data to be uploaded to core

Constructors

SdlFile()

Creates a new instance of SdlFile

public SdlFile()

SdlFile( String fileName, FileType fileType, int id, boolean persistentFile )

Creates a new instance of SdlFile

public SdlFile(String fileName,FileType fileType,int id,boolean persistentFile)

Constructor Parameters

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 name
fileType
a FileType enum value representing the type of the file
id
an int value representing the android resource id of the file
persistentFile
a boolean value that indicates if the file is meant to persist between sessions / ignition cycles

SdlFile( String fileName, FileType fileType, Uri uri, boolean persistentFile )

Creates a new instance of SdlFile

public SdlFile(String fileName,FileType fileType,Uri uri,boolean persistentFile)

Constructor Parameters

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 name
fileType
a FileType enum value representing the type of the file
uri
a URI value representing a file's location. Currently, it only supports local files
persistentFile
a boolean value that indicates if the file is meant to persist between sessions / ignition cycles

SdlFile( String fileName, FileType fileType, byte[] data, boolean persistentFile )

Creates a new instance of SdlFile

public SdlFile(String fileName,FileType fileType,byte[] data,boolean persistentFile)

Constructor Parameters

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 name
fileType
a FileType enum value representing the type of the file
data
a byte array representing the data of the file
persistentFile
a boolean value that indicates if the file is meant to persist between sessions / ignition cycles

SdlFile( StaticIconName staticIconName )

Creates a new instance of SdlFile

public SdlFile(StaticIconName staticIconName)

Constructor Parameters

staticIconName
a StaticIconName enum value representing the name of a static file that comes pre-shipped with the head unit

Methods

setName( String fileName )

Sets the name of the file

public void setName(String fileName)

Method Parameters

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 name

getName()

Gets the name of the file

public java.lang.String getName()

setResourceId( int id )

Sets the resource ID of the file

public void setResourceId(int id)

Method Parameters

id
an int value representing the android resource id of the file

getResourceId()

Gets the resource id of the file

public int getResourceId()

setUri( Uri uri )

Sets the uri of the file

public void setUri(Uri uri)

Method Parameters

uri
a URI value representing a file's location. Currently, it only supports local files

getUri()

Gets the uri of the file

public android.net.Uri getUri()

setFileData( byte[] data )

Sets the byte array that represents the content of the file

public void setFileData(byte[] data)

Method Parameters

data
a byte array representing the data of the file

getFileData()

Gets the byte array that represents the content of the file

public byte getFileData()

setType( FileType fileType )

Sets the type of the file

public void setType(FileType fileType)

Method Parameters

fileType
a FileType enum value representing the type of the file

getType()

Gets the type of the file

public com.smartdevicelink.proxy.rpc.enums.FileType getType()

setPersistent( boolean persistentFile )

Sets whether the file should persist between sessions / ignition cycles

public void setPersistent(boolean persistentFile)

Method Parameters

persistentFile
a boolean value that indicates if the file is meant to persist between sessions / ignition cycles

isPersistent()

Gets whether the file should persist between sessions / ignition cycles

public boolean isPersistent()

setStaticIcon( boolean staticIcon )

Sets the name of the static file. Static files comes pre-shipped with the head unit

public void setStaticIcon(boolean staticIcon)

Method Parameters

staticIcon
a StaticIconName enum value representing the name of a static file that comes pre-shipped with the head unit

isStaticIcon()

Gets the name of the static file. Static files comes pre-shipped with the head unit

public boolean isStaticIcon()

getOverwrite()

Gets the overwrite property for an SdlFile by default its set to false

public boolean getOverwrite()

setOverwrite( boolean overwrite )

Sets the overwrite property for an SdlFile by default its set to false

public void setOverwrite(boolean overwrite)

Method Parameters

overwrite
a boolean value that indicates if a file can be overwritten

hashCode()

Used to compile hashcode for SdlFile for use to compare in overridden equals method

public int hashCode()

equals( Object o )

Uses our custom hashCode for SdlFile objects

public boolean equals(Object o)

Method Parameters

o
- The object to compare

clone()

Creates a deep copy of the object

public com.smartdevicelink.managers.file.filetypes.SdlFile clone()

Inherited Methods

From Class Methods
java.lang.Object getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize
View on GitHub.com
Previous Section Next Section