Skip to main content
KiFS, while able to be managed in all native APIs, has enhanced support in the Java API.

API Initialization

When using KiFS via the Java API, the handler class must be initialized. The examples in the following sections make use of this interface and assume these steps have been taken.
KiFS API Imports
KiFS API Initialization

Directories

In KiFS, a directory is a top-level container for files. A directory cannot be nested within another directory, though a file contained within a directory may have a path that gives the appearance of being contained within one or more nested virtual directories. A directory must exist before files can be uploaded into it.

Creating Directories

To create a KiFS directory, data:
Create Directory Example

Showing Directories

To show the stats of a KiFS directory, data:
Show Directory Example
To show the stats of all KiFS directories, pass null for the directory name:
Show All Directories Example

Deleting Directories

To delete an empty, existing KiFS directory, use the following parameters:
  • data - name of the directory
  • false - don’t delete files contained within the directory, and return an error if any are found
  • false - return an error if the directory is not found
Delete Empty Directory Example
To delete a KiFS directory, data, and all files contained within, regardless of whether the directory exists (similar to a Unix rm -rf):
  • data - name of the directory
  • true - delete any files contained within the directory
  • true - suppress the error in the case that the directory is not found
Delete Non-Empty Directory Example

Files

In KiFS, a file is a user-uploaded text or binary object. Each file is located within a directory and must have a unique name within that directory. The name can contain forward slashes to create the appearance of a hierarchical virtual directory structure and help namespace the files. Overall, each file is referenced by the composite of the directory and file name.

Uploading Files

To upload a file to a KiFS directory, data, under a virtual directory, geo:
Upload Single File Example
To upload a set of files to a KiFS directory, data, under a virtual directory, geo:
Upload Multiple Files Example

Listing Files

To list the KiFS files in a directory, data:
List Files Example

Downloading Files

To download a KiFS file to a local directory, download:
Download Single File Example
To download a set of KiFS files to a local directory, download:
Download Multiple Files Example

Deleting Files

To delete a set of KiFS files:
Delete Multiple Files Example

KiFS Endpoints

The following REST API endpoint calls can also be used to manage KiFS.