Skip to content

FileSystemProvider

Trae Yelovich edited this page Mar 19, 2024 · 16 revisions

Table of Contents
  • File paths vs. URIs
    • Relation to tree nodes
  • Operations
    • Creating directories
    • Copy/paste
    • Reading and writing files
    • Rename
    • Delete

In v3 of Zowe Explorer, we have made an architectural shift from using temporary, on-disk files to using the FileSystemProvider interface provided by VS Code. Starting with v3, the three "core" tree views in Zowe Explorer will use implementations of the FileSystemProvider to encapsulate remote operations (reading/writing, renaming, deleting, etc.):

  • Data Sets
  • Jobs
  • Unix System Services (USS)

We have also exposed a BaseProvider class in Zowe Explorer API to help extenders create their own FileSystemProvider implementations if needed.

File paths vs. URIs

The FileSystemProvider interface largely operates on the concept of resource URIs. Our FileSystemProvider implementations leverage these URIs to build a path structure for the providers to operate. Note that each segment is important when building correct URIs for Zowe Explorer resources.

All core resource URIs for Zowe Explorer use this general structure:

zowe-*:/<Profile Name (LPAR)>/<Resource Path>

Where zowe-* is a scheme that starts with the zowe- prefix. The core schemes are exposed in Zowe Explorer API as the ZoweScheme enum and are defined as the following:

  • Data Sets: zowe-ds
  • Jobs: zowe-jobs
  • USS: zowe-uss
Data Set URIs

For a sequential data set named FRUIT.CHKLIST on the food.zosmf LPAR, the URI would read as follows:

zowe-ds:/food.zosmf/FRUIT.CHKLIST

Partitioned data sets are interpreted as directories in the FileSystemProvider, and members are entries inside the directory.
For example, to represent the member APPLE in PDS FRUIT.BASKET on the food.zosmf LPAR, the URI would be:

zowe-ds:/food.zosmf/FRUIT.BASKET/APPLE
USS URIs

USS URIs use the format zowe-uss:/<Profile Name (LPAR)>/<USS Path> to represent files or folders.
A file at path /u/users/fruit/apple.txt on the food.zosmf LPAR would look like this:

zowe-uss:/food.zosmf/u/users/fruit/apple.txt

It's parent folder, /u/users/fruit/ would look like this:

zowe-uss:/food.zosmf/u/users/fruit/
Job URIs

Job URIs use the format zowe-jobs:/<Profile Name (LPAR)>/<Job ID>/. Spool URIs use the format zowe-jobs:/<Profile Name (LPAR)>/<Job ID>/<Unique Spool ID>.

Extenders can leverage the buildUniqueSpoolName function in Zowe Explorer API to help build spool URIs. The Job ID segment matches the jobid parameter on the IJobFile object.

Clone this wiki locally