GoogleDriveModel

com.github.cloudfiles.gdrive.GoogleDriveModel

A module defining the GoogleDrive-specific implementations for the classes referenced by a file system.

In GoogleDrive, files and folders are both represented by the ''File'' resource. A ''File'' object contains basic properties, some Google-specific properties (such as permissions or information about the shared state), and maps with arbitrary global or application-specific properties. GoogleDriveJsonProtocol defines data classes that correspond to these structures.

The GoogleDrive-specific file and folder implementations reference such a GoogleDriveJsonProtocol.File object storing the underlying data. Their properties obtain their values from this object. The object can also be accessed by client code to access the additional information supported by the GoogleDrive protocol.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

trait GoogleDriveElement extends Element[String]

A trait implementing basic functionality required by the GoogleDrive implementations for ''FileSystem'' files and folders.

A trait implementing basic functionality required by the GoogleDrive implementations for ''FileSystem'' files and folders.

This trait expect that the underlying data is available as a File object. It implements the basic properties by delegating to this object.

Attributes

Supertypes
trait Element[String]
class Object
trait Matchable
class Any
Known subtypes
case class GoogleDriveFile(googleFile: File) extends File[String], GoogleDriveElement

The GoogleDrive-specific implementation of the ''File'' trait

The GoogleDrive-specific implementation of the ''File'' trait

Value parameters

googleFile

the underlying Google ''File'' object

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait File[String]
trait Element[String]
class Object
trait Matchable
class Any
Show all
case class GoogleDriveFolder(googleFile: File) extends Folder[String], GoogleDriveElement

The GoogleDrive-specific implementation of the ''Folder'' trait.

The GoogleDrive-specific implementation of the ''Folder'' trait.

Value parameters

googleFile

the underlying Google ''File'' object

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Folder[String]
trait Element[String]
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def newFile(name: String, id: String, size: Long, description: String, createdAt: Instant, lastModifiedAt: Instant, properties: Map[String, String], appProperties: Map[String, String], mimeType: String): GoogleDriveFile

Constructs a ''GoogleDriveFile'' object for creating or updating a file in the GoogleDrive. For such an operation, typically only parts of the properties supported by a Google file need to be specified. Therefore, this function sets default values for all properties, and the caller only has to specify the relevant ones.

Constructs a ''GoogleDriveFile'' object for creating or updating a file in the GoogleDrive. For such an operation, typically only parts of the properties supported by a Google file need to be specified. Therefore, this function sets default values for all properties, and the caller only has to specify the relevant ones.

Value parameters

appProperties

a map with application-specific properties

createdAt

the time the file was created

description

the description

id

the file ID (needed for update operations)

lastModifiedAt

the time of the last modification

mimeType

the mime type of the file

name

the name of the file

properties

a map with properties for the file

size

the size of the file; note that this property must be set when uploading the file's content

Attributes

Returns

the new ''GoogleDriveFile'' object

def newFolder(name: String, id: String, description: String, createdAt: Instant, lastModifiedAt: Instant, properties: Map[String, String], appProperties: Map[String, String]): GoogleDriveFolder

Constructs a ''GoogleDriveFolder'' object for creating or updating a folder in the GoogleDrive. For such an operation, typically only parts of the properties supported by a Google folder need to be specified. Therefore, this function sets default values for all properties, and the caller only has to specify the relevant ones.

Constructs a ''GoogleDriveFolder'' object for creating or updating a folder in the GoogleDrive. For such an operation, typically only parts of the properties supported by a Google folder need to be specified. Therefore, this function sets default values for all properties, and the caller only has to specify the relevant ones.

Value parameters

appProperties

a map with application-specific properties

createdAt

the time the folder was created

description

the description

id

the folder ID (needed for update operations)

lastModifiedAt

the time of the last modification

name

the name of the folder

properties

a map with properties for the folder

Attributes

Returns

the new ''GoogleDriveFolder'' object

Concrete fields

final val MimeTypeGoogleFolder: "application/vnd.google-apps.folder"

Constant for the mime type used to mark a file in GoogleDrive as a folder.

Constant for the mime type used to mark a file in GoogleDrive as a folder.

Attributes