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
JavaSE Documentation
PutFile

Class PutFile

Hierarchy

java.lang.Object
     com.smartdevicelink.proxy.RPCStruct
         com.smartdevicelink.proxy.RPCMessage
             com.smartdevicelink.proxy.RPCRequest

Package
com.smartdevicelink.proxy.rpc

Overview

Used to push a binary data onto the SDL module from a mobile device, such as icons and album art.

Parameter List

Name Type Description Req. Notes Version Available
FileName String File reference name. Y Maxlength=500 SmartDeviceLink 2.0
fileType FileType Selected file type. Y SmartDeviceLink 2.0
persistentFile Boolean Indicates if the file is meant to persist between sessions / ignition cycles. If set to TRUE,then the system will aim to persist this file through session / cycles. While files with this designation will have priority over others,they are subject to deletion by the system at any time.In the event of automatic deletion by the system, the app will receive a rejection and have to resend the file. If omitted, the value will be set to false. N SmartDeviceLink 2.0
systemFile Boolean Indicates if the file is meant to be passed thru core to elsewhere on the system. If set to TRUE, then the system will instead pass the data thru as it arrives to a predetermined area outside of core. If omitted, the value will be set to false. N SmartDeviceLink 2.3.2
offset Float Optional offset in bytes for resuming partial data chunks N Minvalue=0; Maxvalue=100000000000 SmartDeviceLink 2.3.2
length Float Optional length in bytes for resuming partial data chunks. If offset is set to 0, then length is the total length of the file to be downloaded N Minvalue=0; Maxvalue=100000000000 SmartDeviceLink 2.3.2
crc Long Additional CRC32 checksum to protect data integrity up to 512 Mbits . N minvalue="0" maxvalue="4294967295" SmartDeviceLink 2.3.2

Note:

When using PutFiles you may want to check for memory

Response

Response is sent, when the file data was copied (success case). Or when an error occurred. Not supported on First generation SDL modules.

Non-default Result Codes:

SUCCESS

INVALID_DATA

OUT_OF_MEMORY

TOO_MANY_PENDING_REQUESTS

APPLICATION_NOT_REGISTERED

GENERIC_ERROR

REJECTED

Name Type Description Req. Notes Version Available
spaceAvailable Integer Provides the total local space available on SDL for the registered app. Minvalue=0; Maxvalue=2000000000 SmartDeviceLink 2.0

Fields

KEY_PERSISTENT_FILE

public static final java.lang.String KEY_PERSISTENT_FILE
Constant Value
"persistentFile"

KEY_SYSTEM_FILE

public static final java.lang.String KEY_SYSTEM_FILE
Constant Value
"systemFile"

KEY_FILE_TYPE

public static final java.lang.String KEY_FILE_TYPE
Constant Value
"fileType"

KEY_SDL_FILE_NAME

public static final java.lang.String KEY_SDL_FILE_NAME
Constant Value
"syncFileName"

KEY_OFFSET

public static final java.lang.String KEY_OFFSET
Constant Value
"offset"

KEY_LENGTH

public static final java.lang.String KEY_LENGTH
Constant Value
"length"

KEY_CRC

public static final java.lang.String KEY_CRC
Constant Value
"crc"

Inherited Fields

From Class Fields
com.smartdevicelink.proxy.RPCRequest onResponseListener
com.smartdevicelink.proxy.RPCMessage KEY_REQUEST, KEY_RESPONSE, KEY_NOTIFICATION, KEY_FUNCTION_NAME, KEY_PARAMETERS, KEY_CORRELATION_ID, messageType, parameters, function
com.smartdevicelink.proxy.RPCStruct KEY_BULK_DATA, KEY_PROTECTED, store

Constructors

PutFile()

Constructs a new PutFile object

public PutFile()

PutFile( java.util.Hashtable<java.lang.String, java.lang.Object> hash )

Constructs a new PutFile object indicated by the Hashtable parameter

public PutFile(java.util.Hashtable<java.lang.String, java.lang.Object> hash)

Constructor Parameters

hash
The Hashtable to use

PutFile( String syncFileName, FileType fileType )

Constructs a new PutFile object

public PutFile(String syncFileName,FileType fileType)

Constructor Parameters

syncFileName
a String value representing a file reference name Notes: Maxlength=500, however the max file name length may vary based on remote filesystem limitations
fileType
a FileType value representing a selected file type

Methods

setSdlFileName( String sdlFileName )

Sets a file reference name

public com.smartdevicelink.proxy.rpc.PutFile setSdlFileName(String sdlFileName)

Method Parameters

sdlFileName
a String value representing a file reference name

Notes: Maxlength=500, however the max file name length may vary based on remote filesystem limitations

getSdlFileName()

Gets a file reference name

public java.lang.String getSdlFileName()

setFileType( FileType fileType )

Sets file type

public com.smartdevicelink.proxy.rpc.PutFile setFileType(FileType fileType)

Method Parameters

fileType
a FileType value representing a selected file type

getFileType()

Gets a file type

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

setPersistentFile( Boolean persistentFile )

Sets a value to indicates if the file is meant to persist between sessions / ignition cycles. If set to TRUE, then the system will aim to persist this file through session / cycles. While files with this designation will have priority over others, they are subject to deletion by the system at any time. In the event of automatic deletion by the system, the app will receive a rejection and have to resend the file. If omitted, the value will be set to false

public com.smartdevicelink.proxy.rpc.PutFile setPersistentFile(Boolean persistentFile)

Method Parameters

persistentFile
a Boolean value

getPersistentFile()

Gets a value to Indicates if the file is meant to persist between sessions / ignition cycles

public java.lang.Boolean getPersistentFile()

setFileData( byte[] fileData )

public com.smartdevicelink.proxy.rpc.PutFile setFileData(byte[] fileData)

Method Parameters

fileData

getFileData()

public byte getFileData()

setOffset( Integer offset )

Deprecated

public com.smartdevicelink.proxy.rpc.PutFile setOffset(Integer offset)

Method Parameters

offset
Optional offset in bytes for resuming partial data chunks

setOffset( Long offset )

public com.smartdevicelink.proxy.rpc.PutFile setOffset(Long offset)

Method Parameters

offset
Optional offset in bytes for resuming partial data chunks

getOffset()

public java.lang.Long getOffset()

setLength( Integer length )

Deprecated

public com.smartdevicelink.proxy.rpc.PutFile setLength(Integer length)

Method Parameters

length
Optional length in bytes for resuming partial data chunks. If offset is set to 0, then length is the total length of the file to be downloaded

setLength( Long length )

public com.smartdevicelink.proxy.rpc.PutFile setLength(Long length)

Method Parameters

length
Optional length in bytes for resuming partial data chunks. If offset is set to 0, then length is the total length of the file to be downloaded

getLength()

public java.lang.Long getLength()

setSystemFile( Boolean systemFile )

public com.smartdevicelink.proxy.rpc.PutFile setSystemFile(Boolean systemFile)

Method Parameters

systemFile

getSystemFile()

public java.lang.Boolean getSystemFile()

setCRC( byte[] fileData )

This takes the file data as an array of bytes and calculates the CRC32 for it.

public com.smartdevicelink.proxy.rpc.PutFile setCRC(byte[] fileData)

Method Parameters

fileData
- the file as a byte array

setCRC( Long crc )

This assumes you have created your own CRC32 and are setting it with the file Please avoid using your own calculations for this, and use the method included in java.util

public com.smartdevicelink.proxy.rpc.PutFile setCRC(Long crc)

Method Parameters

crc
- the CRC32 of the file being set

getCRC()

This returns the CRC, if it has been set, for the file object

public java.lang.Long getCRC()

Inherited Methods

From Class Methods
com.smartdevicelink.proxy.RPCRequest getCorrelationID, setCorrelationID, setOnRPCResponseListener, getOnRPCResponseListener
com.smartdevicelink.proxy.RPCMessage getFunctionID, getFunctionName, setFunctionName, getMessageType, setParameters, getParameters, getObject, getString, getInteger, getFloat, getDouble, getBoolean, getLong
com.smartdevicelink.proxy.RPCStruct getStoreValue, getStore, deserializeJSON, serializeJSON, serializeJSON, format, getBulkData, setBulkData, setPayloadProtected, isPayloadProtected, getMessageTypeName, hasKey, setValue, getValue, getObject, formatObject, getValueForString, getString, getInteger, getDouble, getFloat, getBoolean, getLong, clone, equals, hashCode
java.lang.Object getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize
View on GitHub.com
Previous Section Next Section