FolderContent

com.github.cloudfiles.core.Model.FolderContent
case class FolderContent[ID, FILE, FOLDER](folderID: ID, files: Map[ID, FILE], folders: Map[ID, FOLDER])

A data class that stores the content of a specific folder.

An instances contains the (sub) folders and files contained in the represented folder. They are organized in maps, so that they can be accessed directly by their IDs.

Type parameters

FILE

the type to represent a file

FOLDER

the type to represent a folder

ID

the type to represent an ID

Value parameters

files

a map with the files contained in this folder

folderID

the ID of the represented folder

folders

a map with the sub folders of this folder

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def mapContent(mapFiles: Option[FILE => FILE], mapFolders: Option[FOLDER => FOLDER]): FolderContent[ID, FILE, FOLDER]

Applies mappings to the content stored in this object. The mapping functions that are defined are invoked on the files and folders, and a new instance is created with the results. Note: The mapping functions must not change the IDs of elements.

Applies mappings to the content stored in this object. The mapping functions that are defined are invoked on the files and folders, and a new instance is created with the results. Note: The mapping functions must not change the IDs of elements.

Value parameters

mapFiles

optional mapping function on files

mapFolders

optional mapping function on folders

Attributes

Returns

the result of the mapping

def mapContentParallel(mapFiles: Option[FILE => FILE], mapFolders: Option[FOLDER => FOLDER])(implicit ec: ExecutionContext): Future[FolderContent[ID, FILE, FOLDER]]

Applies mappings in parallel to the content stored in this object. This function is analogous to ''mapContent()'', but invocations to mapping functions are wrapped in ''Future'' objects, and therefore run concurrently. The resulting future completes when all mappings are done.

Applies mappings in parallel to the content stored in this object. This function is analogous to ''mapContent()'', but invocations to mapping functions are wrapped in ''Future'' objects, and therefore run concurrently. The resulting future completes when all mappings are done.

Value parameters

ec

the execution context

mapFiles

optional mapping function on files

mapFolders

optional mapping function on folders

Attributes

Returns

a ''Future'' with the result of the mapping

def mapContentParallelTried(mapFiles: Option[FILE => Try[FILE]], mapFolders: Option[FOLDER => Try[FOLDER]])(implicit ec: ExecutionContext): Future[(FolderContent[ID, FILE, FOLDER], List[Failure[ID]])]

Applies mappings in parallel to the content stored in this object that can fail. This function is analogous to ''mapContentParallel()'', but the passed in mapping functions return a ''Try''. Result is a ''Future'' with a tuple that contains a ''FolderContent'' object with all the files and folders that could be mapped successfully, and a list with failures that occurred during mapping.

Applies mappings in parallel to the content stored in this object that can fail. This function is analogous to ''mapContentParallel()'', but the passed in mapping functions return a ''Try''. Result is a ''Future'' with a tuple that contains a ''FolderContent'' object with all the files and folders that could be mapped successfully, and a list with failures that occurred during mapping.

Value parameters

ec

the execution context

mapFiles

optional mapping function on files

mapFolders

optional mapping function on folders

Attributes

Returns

a ''Future'' with the results of the mapping

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product