Files
Organize data in content objects as file and directory structure.
Creation / Modification
-
Create a Files Job and submit the list of files that will be uploaded in one or multiple batch requests. For each file, its path, exact size and optional metadata (e.g. mime type) are specified.
The fabric automatically maps files to parts in order to optimize part storage: small files are aggregated into a single part, large files are split across multiple parts. For each part, an Upload Job is returned that contains the list of files or file segments that are to be uploaded in order.
Adding files is only one of multiple operations that can be specified in a Files Job: files can also be deleted, moved, copied, or their metadata updated. As these additional operations apply to existing files in the content object, they only make sense when creating new versions of existing content objects or when modifying a previous Files Job.
-
Upload file data according to the generated upload jobs. For improved performance, upload jobs may be performed in parallel.
In case of upload failures, retrieve the status of the corresponding upload job to find out at which position the upload should be resumed.
-
Once all data is uploaded, finalize the files. The fabric will by check that all necessary file data has been uploaded and will optimize the file metadata structures.
Reading File Metadata
Example file metadata:
{
"files" : {
".": {
"type": "directory"
},
"html": {
".": {
"type": "directory"
},
"index.html": {
".": {
"mime_type": "text/html",
"parts": [ 0 ],
"size": 3144
}
}
},
"images": {
".": {
"type": "directory"
},
"logo.png": {
".": {
"parts": [ 1 ],
"size": 46943
}
}
}
}
}
The directory structure and file information is stored as regular metadata of the content object under the files
key. Each item (directory or file) is stored as an object labelled with its name and using an embedded . key to
store the item's metadata like type (file or directory), size, mime-type, etc.
Downloading Files
The files API provides a download endpoint for retrieving a file identified by its path. It supports the standard HTTP Range header to retrieve partial files.
Symbolic Links
The file hierarchy supports symbolic links to other files or directories similar to a Unix filesystem. Links are created in a Files Job (just like regular files), but obviously don't require a subsequent data upload, since they merely point to another file or directory.
File links may be relative, pointing to other files or directories within the same content object, or absolute by targeting an entry in another content object. See file links for details.
List Files Job
List Files Jobs.
Create Files Job
Create a new Files Job and optionally advertise file operations.
Add More Operations to Files Job
The request specifies a list of additional file operations to perform. It must follow a prior request to create
Status of a Files Job
Retrieve the progress of the construction status of a Files Job.
List Upload Jobs
Retrieve the upload job IDs for a Files Job.
Status of an Upload Job
Retrieve the status of an Upload Job in a Files Job.
Upload File Data
Upload binary data for a previously created upload job
Resume the Files job
Resume may be used to retry a job after transient ingest failures and/or
Force Completion of the Files job
Force completion may be used to force a job to completion after ingest failures.
Finalize Files
Finalize the files in the content object by checking that all necessary
List files
List all files at a given path.
Download or List Files
Download or list the file at the given path.
File Info
Retrieve only info (via status code and headers) for the file at the given path.