Inherits from NSObject
Declared in NMBFileForm.h

Overview

NMBFileForm is responsible for collecting information of a file when you want to create or update it.

Properties

content

The content of the file.

@property (nonatomic, copy) NSData *content

Declared In

NMBFileForm.h

extension

The extension of the file.

@property (nonatomic, assign) NSString *extension

Declared In

NMBFileForm.h

isFolder

Indicates if the file represents a folder.

@property (nonatomic, assign) BOOL isFolder

Declared In

NMBFileForm.h

mime

The mime of the file.

@property (nonatomic, copy) NSString *mime

Declared In

NMBFileForm.h

name

The name of the file.

@property (nonatomic, copy) NSString *name

Declared In

NMBFileForm.h

urlOnDisk

When you set the property content, it will be serialized on disk. This property indicates the url of the serialized data.

@property (nonatomic, readonly, copy) NSURL *urlOnDisk

Declared In

NMBFileForm.h

Class Methods

folderWithName:

The convenient method to new a NMBFileForm represents a folder.

+ (instancetype)folderWithName:(NSString *)name

Parameters

name

The name of the folder.

Declared In

NMBFileForm.h

rename:file:

Initializes the receiver with the new name the related file is supposed to be renamed to.

+ (instancetype)rename:(NSString *)name file:(NMBFile *)file

Parameters

name

The new name of the related file.

file

The file need to be renamed.

Return Value

An instance of NMBFileForm has same properties with original file except the name.

Declared In

NMBFileForm.h

Instance Methods

initWithFile:

When you want to update a file, this method help you to copy all properties of the file conveniently.

- (instancetype)initWithFile:(NMBFile *)file

Parameters

file

The source file.

Return Value

An instance of NMBFileForm has same properties with source file.

Declared In

NMBFileForm.h

setContentViaURL:

If the file content you want to upload is on the disk, you can use this method to avoid unnecessary memory cost.

- (BOOL)setContentViaURL:(NSURL *)fromURL

Parameters

fromURL

The file url of the content on the disk.

Return Value

Whether the file content is successfully to be set.

Declared In

NMBFileForm.h