Crates an SDLFile from a file
Whether or not the file should persist on disk between car ignition cycles.
@property (nonatomic, readonly, getter=isPersistent) BOOL persistent;
var isPersistent: Bool { get }
Whether or not the file should overwrite an existing file on the remote disk with the same name.
@property (nonatomic) BOOL overwrite;
var overwrite: Bool { get set }
The name the file should be stored under on the remote disk. This is how the file will be referenced in all later calls.
@property (nonatomic, copy, readonly) NSString *_Nonnull name;
var name: String { get }
The url the local file is stored at while waiting to push it to the remote system. If the data has not been passed to the file URL, this will be nil.
@property (nonatomic, copy, readonly, nullable) NSURL *fileURL;
var fileURL: URL? { get }
The binary data of the SDLFile. If initialized with data, this will be a relatively quick call, but if initialized with a file URL, this is a rather expensive call the first time. The data will be cached in RAM after the first call.
@property (nonatomic, copy, readonly) NSData *_Nonnull data;
var data: Data { get }
The size of the binary data of the SDLFile.
@property (nonatomic, readonly) unsigned long long fileSize;
var fileSize: UInt64 { get }
The system will attempt to determine the type of file that you have passed in. It will default to BINARY if it does not recognize the file type or the file type is not supported by SDL.
@property (nonatomic, strong, readonly) SDLFileType _Nonnull fileType;
var fileType: SDLFileType { get }
A stream to pull binary data from a SDLFile. The stream only pulls required data from the file on disk or in memory. This reduces memory usage while uploading a large file to the remote system as each chunk of data can be released immediately after it is uploaded.
@property (nonatomic, readonly) NSInputStream *_Nonnull inputStream;
var inputStream: InputStream { get }
Describes whether or not this file is represented by static icon data. The head unit will present its representation of the static icon concept when sent this data.
A file that represents a static icon may not be uploaded via the File Manager. It must be set using the Screen Manager.
Support for this feature may vary by system, but it will generally be more supported in soft buttons and menus.
@property (nonatomic, readonly) BOOL isStaticIcon;
var isStaticIcon: Bool { get }
Initializer unavailable
- (nonnull instancetype)init;
The designated initializer for an SDL File. The only major property that is not set using this is “overwrite”, which defaults to NO.
- (nonnull instancetype)initWithFileURL:(nonnull NSURL *)url
name:(nonnull NSString *)name
persistent:(BOOL)persistent;
init(fileURL url: URL, name: String, persistent: Bool)
The file URL pointing to the local data that will be pushed to the remote system.
The name that the file will be stored under on the remote system and how it will be referenced from the local system. The max file name length may vary based on remote filesystem limitations.
Whether or not the file will persist between ignition cycles.
An SDLFile object.
Create an SDL file using a local file URL.
This is a persistent file, it will be persisted through sessions / ignition cycles. You will only have a limited space for all files, so be sure to only persist files that are required for all or most sessions. For example, menu artwork should be persistent.
Ephemeral files should be created using ephemeralFileAtURL:name:
Warning
If this is not a readable file, this will return nil
+ (nonnull instancetype)persistentFileAtFileURL:(nonnull NSURL *)url
name:(nonnull NSString *)name;
The url to the file that should be uploaded.
The name of the file that will be used to reference the file in the future (for example on the remote file system). The max file name length may vary based on remote filesystem limitations.
An instance of this class, or nil if a readable file at the path could not be found.
Create an SDL file using a local file URL.
This is an ephemeral file, it will not be persisted through sessions / ignition cycles. Any files that you do not know you will use in future sessions should be created through this method. For example, album / artist artwork should be ephemeral.
Persistent files should be created using persistentFileAtURL:name:
Warning
If this is not a readable file, this will return nil
+ (nonnull instancetype)fileAtFileURL:(nonnull NSURL *)url
name:(nonnull NSString *)name;
convenience init(atFileURL url: URL, name: String)
The url to the file on disk that will be uploaded
The name of the file that will be used to reference the file in the future (for example on the remote file system). The max file name length may vary based on remote file system limitations.
An instance of this class, or nil if a readable file at the url could not be found.
Create an SDL file using raw data. It is strongly preferred to pass a file URL instead of data, as it is currently held in memory until the file is sent.
- (nonnull instancetype)initWithData:(nonnull NSData *)data
name:(nonnull NSString *)name
fileExtension:(nonnull NSString *)extension
persistent:(BOOL)persistent;
init(data: Data, name: String, fileExtension extension: String, persistent: Bool)
The raw data to be used for the file
The name of the file that will be used to reference the file in the future (for example on the remote file system). The max file name length may vary based on remote file system limitations.
The file extension. For example “png”. Currently supported file extensions are: “bmp”, “jpg”, “jpeg”, “png”, “wav”, “mp3”, “aac”, “json”. All others will be sent as binary files.
Whether or not the remote file with this data should be persistent
An instance of this class
Create an SDL file using raw data. It is strongly preferred to pass a file URL instead of data, as it is currently held in memory until the file is sent.
This is a persistent file, it will be persisted through sessions / ignition cycles. You will only have a limited space for all files, so be sure to only persist files that are required for all or most sessions. For example, menu artwork should be persistent.
+ (nonnull instancetype)persistentFileWithData:(nonnull NSData *)data
name:(nonnull NSString *)name
fileExtension:(nonnull NSString *)extension;
The raw data to be used for the file
The name of the file that will be used to reference the file in the future (for example on the remote file system). The max file name length may vary based on remote file system limitations.
The file extension. For example “png”. Currently supported file extensions are: “bmp”, “jpg”, “jpeg”, “png”, “wav”, “mp3”, “aac”, “json”. All others will be sent as binary files.
An instance of this class
Create an SDL file using raw data. It is strongly preferred to pass a file URL instead of data, as it is currently held in memory until the file is sent.
This is an ephemeral file, it will not be persisted through sessions / ignition cycles. Any files that you do not know you will use in future sessions should be created through this method. For example, album / artist artwork should be ephemeral.
+ (nonnull instancetype)fileWithData:(nonnull NSData *)data
name:(nonnull NSString *)name
fileExtension:(nonnull NSString *)extension;
convenience init(data: Data, name: String, fileExtension extension: String)
The raw data to be used for the file
The name of the file that will be used to reference the file in the future (for example on the remote file system). The max file name length may vary based on remote file system limitations.
The file extension. For example “png”. Currently supported file extensions are: “bmp”, “jpg”, “jpeg”, “png”, “wav”, “mp3”, “aac”, “json”. All others will be sent as binary files.
An instance of this class