Builder used to create a new instance of CreateFileActivityOptions
.
Field Summary
protected final CreateFileActivityBuilder | builder |
Public Constructor Summary
Public Method Summary
CreateFileActivityOptions |
build()
Builds the
CreateShortcutFileActivityOptions with the current
options.
|
CreateFileActivityOptions.Builder |
setActivityStartFolder(DriveId
folder)
Sets the folder that the create file dialog activity will initially display to
folder .
|
CreateFileActivityOptions.Builder | |
CreateFileActivityOptions.Builder |
setInitialDriveContents(DriveContents
driveContents)
Sets the initial contents for the new file to
driveContents .
|
CreateFileActivityOptions.Builder |
setInitialMetadata(MetadataChangeSet
metadataChangeSet)
Sets the initial metadata for the new file to
metadataChangeSet .
|
Inherited Method Summary
Fields
protected final CreateFileActivityBuilder builder
Public Constructors
public CreateFileActivityOptions.Builder ()
Public Methods
public CreateFileActivityOptions build ()
Builds the CreateShortcutFileActivityOptions
with the current
options.
Throws
NullPointerException | if
setInitialMetadata(MetadataChangeSet) was not called |
---|---|
IllegalStateException | if
setInitialDriveContents(DriveContents) was not called |
public CreateFileActivityOptions.Builder setActivityStartFolder (DriveId folder)
Sets the folder that the create file dialog activity will initially display to
folder
. If not specified, it will default to the root "My Drive" folder.
The activity supports navigation from this folder to other folders.
public CreateFileActivityOptions.Builder setActivityTitle (String title)
Sets the title of the dialog activity to title
.
public CreateFileActivityOptions.Builder setInitialDriveContents (DriveContents driveContents)
Sets the initial contents for the new file to driveContents
. In order
to create the file with empty contents, pass in null
. It is recommended
that files with a mime-type that does not support having a zero-byte file (e.g. an
image or PDF) is created as a non-empty file.
driveContents
must be obtained through
createContents()
. Once this method returns, driveContents
will
be persisted and closed. In order to continue editing the file's contents, they must be
opened again with
openFile(DriveFile, int)
or
openFile(DriveFile, int, OpenFileCallback)
.
public CreateFileActivityOptions.Builder setInitialMetadata (MetadataChangeSet metadataChangeSet)
Sets the initial metadata for the new file to metadataChangeSet
.
This method must be called or
build()
will fail. A new MetadataChangeSet
can be created using MetadataChangeSet.Builder
.