public class PutFile extends RPCRequest
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 memoryResponse
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 |
DeleteFile,
ListFiles| Modifier and Type | Field and Description |
|---|---|
static String |
KEY_CRC |
static String |
KEY_FILE_TYPE |
static String |
KEY_LENGTH |
static String |
KEY_OFFSET |
static String |
KEY_PERSISTENT_FILE |
static String |
KEY_SDL_FILE_NAME |
static String |
KEY_SYSTEM_FILE |
onResponseListenerfunction, KEY_CORRELATION_ID, KEY_FUNCTION_NAME, KEY_NOTIFICATION, KEY_PARAMETERS, KEY_REQUEST, KEY_RESPONSE, messageType, parametersKEY_BULK_DATA, KEY_PROTECTED, store| Constructor and Description |
|---|
PutFile()
Constructs a new PutFile object
|
PutFile(Hashtable<String,Object> hash)
Constructs a new PutFile object indicated by the Hashtable parameter
|
PutFile(String syncFileName,
FileType fileType)
Constructs a new PutFile object
|
| Modifier and Type | Method and Description |
|---|---|
Long |
getCRC()
This returns the CRC, if it has been set, for the file object
|
byte[] |
getFileData() |
FileType |
getFileType()
Gets a file type
|
Long |
getLength() |
Long |
getOffset() |
Boolean |
getPersistentFile()
Gets a value to Indicates if the file is meant to persist between
sessions / ignition cycles
|
String |
getSdlFileName()
Gets a file reference name
|
Boolean |
getSystemFile() |
PutFile |
setCRC(byte[] fileData)
This takes the file data as an array of bytes and calculates the
CRC32 for it.
|
PutFile |
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
|
PutFile |
setFileData(byte[] fileData) |
PutFile |
setFileType(FileType fileType)
Sets file type
|
PutFile |
setLength(Integer length)
Deprecated.
as of SmartDeviceLink 4.0. Use
setLength(Long) instead. |
PutFile |
setLength(Long length) |
PutFile |
setOffset(Integer offset)
Deprecated.
as of SmartDeviceLink 4.0. Use
setOffset(Long) instead. |
PutFile |
setOffset(Long offset) |
PutFile |
setPersistentFile(Boolean persistentFile)
Sets a value to indicates if the file is meant to persist between
sessions / ignition cycles.
|
PutFile |
setSdlFileName(String sdlFileName)
Sets a file reference name
|
PutFile |
setSystemFile(Boolean systemFile) |
getCorrelationID, getOnRPCResponseListener, setCorrelationID, setOnRPCResponseListenergetBoolean, getDouble, getFloat, getFunctionID, getFunctionName, getInteger, getLong, getMessageType, getObject, getParameters, getString, setFunctionName, setParametersclone, deserializeJSON, equals, format, formatObject, getBulkData, getMessageTypeName, getStore, getStoreValue, getValue, getValueForString, hashCode, hasKey, isPayloadProtected, serializeJSON, serializeJSON, setBulkData, setPayloadProtected, setValuepublic static final String KEY_PERSISTENT_FILE
public static final String KEY_SYSTEM_FILE
public static final String KEY_FILE_TYPE
public static final String KEY_SDL_FILE_NAME
public static final String KEY_OFFSET
public static final String KEY_LENGTH
public static final String KEY_CRC
public PutFile()
public PutFile(Hashtable<String,Object> hash)
hash - The Hashtable to usepublic PutFile(@NonNull
String syncFileName,
@NonNull
FileType fileType)
syncFileName - a String value representing a file reference name
Notes: Maxlength=500, however the max file name length may vary based on remote filesystem limitationsfileType - a FileType value representing a selected file typepublic PutFile setSdlFileName(@NonNull String sdlFileName)
sdlFileName - a String value representing a file reference name
Notes: Maxlength=500, however the max file name length may vary based on remote filesystem limitationspublic String getSdlFileName()
public PutFile setFileType(@NonNull FileType fileType)
fileType - a FileType value representing a selected file typepublic FileType getFileType()
public PutFile setPersistentFile(Boolean persistentFile)
persistentFile - a Boolean valuepublic Boolean getPersistentFile()
public PutFile setFileData(byte[] fileData)
public byte[] getFileData()
public PutFile setOffset(Integer offset)
setOffset(Long) instead.offset - Optional offset in bytes for resuming partial data chunkspublic PutFile setOffset(Long offset)
offset - Optional offset in bytes for resuming partial data chunkspublic Long getOffset()
public PutFile setLength(Integer length)
setLength(Long) instead.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 downloadedpublic PutFile setLength(Long length)
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 downloadedpublic Long getLength()
public Boolean getSystemFile()
public PutFile setCRC(byte[] fileData)
fileData - - the file as a byte arraypublic PutFile setCRC(Long crc)
crc - - the CRC32 of the file being setpublic Long getCRC()