Folders and Deletion
Data containers organize objects into folders. Each data object or folder can exist within one parent folder, and the system prevents circular references. The root folder, designated by the path /, serves as the default location for new objects and cannot be moved, cloned, or removed.
The system treats consecutive / characters as a single / and ignores trailing / characters in folder paths. You can rename, move, and remove folders as needed.
Folder Naming Requirements
Individual folder names have the following requirements:
Must contain between 1 and 2,048 characters in UTF-8 encoding.
Cannot be
.or...Cannot include control characters (matching the regular expression
[\x00-\x1F]).
Complete folder paths have the following requirements:
Must be under 10,240 characters total.
Cannot exceed 128 nested folder levels. That is the root folder
/with up to 128 subfolders.
Deletion of Data
When you remove data objects, the system automatically removes any hidden linked objects that can no longer be reached from other visible objects in the same data container through one or more links. For detailed information about object details, links, and visibility, see Details and Links and Visibility.
You can remove objects in any state, but this action cannot be undone. Removing open objects may cause additional effects, such as making upload URLs invalid. To remove objects, use either the /class-xxxx/removeFolder or /class-xxxx/removeObjects API methods.
API Methods
API method: /class-xxxx/newFolder
/class-xxxx/newFolderSpecification
Creates a new folder in the data container using the given path.
Inputs
folderstring The new folder to be created in the data container. Must meet the folder naming requirements.parentsboolean (optional, default false) Whether the parent folders should be created if they do not exist
Outputs
idstring ID of the manipulated data container
Errors
InvalidInput (the input is not a hash, or
folderis missing or is not a nonempty string starting with "/", orparentsis present but is not a boolean)ResourceNotFound (the specified data container does not exist, or
parentsis false but the parent folder of the folder specified infolderdoes not yet exist)InvalidState (a folder with the given path already exists and
parentswas not set to true)PermissionDenied (UPLOAD access required)
API method: /class-xxxx/renameFolder
/class-xxxx/renameFolderSpecification
Renames a current folder in the data container with the given name.
Inputs
folderstring Folder to be renamednamestring The new name of the folder (to replace the string after the last "/" infolder). Must meet the folder naming requirements.
Outputs
idstring ID of the manipulated data container
Errors
InvalidInput (the input is not a hash, or
folderis missing or is not a nonempty string starting with "/",folderis "/",nameis missing or is not a nonempty string with no "/")ResourceNotFound (the specified data container does not exist, or the specified folder does not exist)
InvalidState (a folder with the given path already exists)
PermissionDenied (CONTRIBUTE access required)
API method: /class-xxxx/listFolder
/class-xxxx/listFolderSpecification
Lists the contents of a given data container's folder. Only folders or only objects can be specified to be returned, though this method returns both folders and objects by default. This method does not return hidden objects unless includeHidden is set to true.
Inputs
folderstring (optional, default "/") The folder to be listeddescribeboolean or mapping (optional, default false) False indicates that no extra metadata should be retrieved with the data object results. A mapping represents the input that would be used for calling the result's corresponding describe method. The value true is equivalent to the empty hash input.onlystring (optional, default "all") Indicate what type of contents to return. One of the values "folders", "objects", or "all"includeHiddenboolean (optional, default false) Whether hidden objects should be returned inobjects. Applicable only ifonlyis set to "objects" or "all".hasSubfolderFlagsboolean (optional, default false) Indicate whether a folder has subfolders
Outputs
objectsarray of mappings List of metadata for all data objects in the specified folder, each with the key/values:idstring The object IDIf
describewas set to true or a mapping:describemapping The output of the result's corresponding describe method
foldersarray of strings or array of arrays By default, this is a list of all folders directly under the specified folder. If the 'hasSubfolderFlags' input is set to true, the array contains arrays of exactly two elements where the first element is a string of the folder name and the second element is a boolean that is set to true if the folder has subfolders and false otherwise.
Errors
InvalidInput
The input is not a hash
folderis not a nonempty string starting with "/"onlyis given but is not one of "folders", "objects", and "all"includeHiddenis present but is not a boolean
ResourceNotFound
The specified data container does not exist
A folder with the given path does not exist
PermissionDenied (VIEW access required)
API method: /class-xxxx/removeFolder
/class-xxxx/removeFolderSpecification
Removes the given folder in the data container using the given path. The folder must contain no visible data objects to be removed unless recurse is set to true. Removing the root folder "/" with recurse set to true removes ALL the contents in the data container. Setting recurse to true should be used carefully to prevent accidental deletion of data. Removing a folder removes all the visible objects contained in it and all their orphaned hidden links. Any remaining hidden objects that are not removed by this process are placed in the root folder. In particular, if recurse is false and the folder to be removed only contains hidden objects, then these objects are similarly placed in the root folder, and the specified folder folder is removed.
The API call has a limit of 10,000 data objects that can be removed regardless of visibility. If a folder's contents goes above this threshold, one can set partial to true to allow for a partial removal of the folder's contents up to this limit. A completed flag in the output indicates whether the folder was fully removed. If completed is false, reissue the API call with the partial flag to continue removing the folder.
Inputs
folderstring The folder to be removed from the data containerrecurseboolean (optional, default false) Whether removal should propagate to its contained folders and objectsforceboolean (optional, default false) If true, this operation should not throw an error even if the given folder does not existpartialboolean (optional, default false) If true, this operation attempts to remove objects from the folder even if the folder contains more objects than can be deleted at one time.
Outputs
idstring ID of the manipulated data containerIf
partialwas set to true:completedboolean True if all objects, subfolders, and the specified folder have been removed. False if there are still objects remaining indicating the user should reissue the call to further progress.
Errors
InvalidInput (the input is not a hash,
folderis missing,folderis not set to a nonempty string starting with "/",folderis set to "/" butrecurseis not specified or is false,recurseis provided and is not a boolean)ResourceNotFound
The specified data container does not exist
A folder with the given path does not exist and
forcewas not set to true
PermissionDenied (CONTRIBUTE access required)
InvalidState
The project contains a DBCluster in a non-terminal state
recurseis false and the specified folder contains either subfolders or visible objectspartialis false and the specified folder contains more objects than can be deleted in one API call. For more information, see Service Limits.
API method: /class-xxxx/move
/class-xxxx/moveSpecification
Moves the specified objects and/or folders into the specified folder. Objects and folders can be moved from any state and any folder in the data container. Objects and folders in a folder listed in folders remain in the (moved) folder unless explicitly listed in objects or folders. In that case, they are removed from their parent folder and moved to the destination folder described in folder. Objects explicitly listed in objects also move any linked hidden objects to the folder indicated as destination.
Inputs
objectsarray of strings (optional) List of data object IDs to be movedfoldersarray of strings (optional) List of folders to be moveddestinationstring The destination folder
Outputs
idstring ID of the manipulated data container
Errors
InvalidInput (the input is not a hash,
objects(if provided) is not an array of nonempty strings,folders(if provided) is not an array of nonempty strings starting with "/", two of the folders infoldershave the same name but different paths,destinationis missing or is not a nonempty string starting with "/")ResourceNotFound (the specified data container does not exist, one of the specified objects and/or folders does not exist in the specified data container, or the destination folder does not exist)
PermissionDenied (CONTRIBUTE access required)
InvalidState (a folder listed in
foldersis or contains the destination folder)
API method: /class-xxxx/removeObjects
/class-xxxx/removeObjectsSpecification
Removes the specified objects from the data container. When you remove objects, the system also removes any hidden linked objects that can no longer be reached from other visible objects in the same data container through one or more links. You can remove objects in any state, but this action cannot be undone.
Removing open objects may cause additional effects, such as making upload URLs invalid. To restore a removed object to the data container, you must have a copy in another data container and the proper permissions to clone it back. When cloning an object back, any previously set custom metadata is lost and replaced with metadata from the source data container. For more information, see Cloning.
Inputs
objectsarray of strings List of object IDs to be removed from the data containerforceboolean (optional, default false) If true, this operation should not throw an error even if the given object does not exist
Outputs
idstring ID of the manipulated data container
Errors
InvalidInput (the input is not a hash, or
objectsis missing or is not an array of nonempty strings)ResourceNotFound
The specified data container does not exist
An object with the given ID does not exist or does not exist in the specified data container and
forcewas not set to true
PermissionDenied (CONTRIBUTE/ADMINISTER access required, depending on PROTECTED flag)
InvalidState
One of the objects is a DBCluster in a non-terminal state
Last updated
Was this helpful?