Skip to content

Overview

Concepts and Principles

Development

Overview

IDEs

API Explorer

Releases

Release Notes

TORO Integrate

Coder Studio

Coder Cloud

Bug Reports

Search

Using One-Liners from the VfsMethods class for File Operations

Introduction

The one-liners residing in the VfsMethods class is for managing virtual file systems. The examples package shows how these methods can be used in order to send or create a file in Dropbox, Google Drive, OneDrive, Amazon S3, FTP, and SFTP.

Related articles

Please see the following articles for more information:

Try It!

Under the Coder Navigator, expand the examples package entry and navigate to the code folder. Afterwards, look for the vfs package. This package contains the following files and directories, shown below:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
examples
├── ...
└── code
    └── vfs
        ├── services
        │   ├── DropboxService.gloop
        │   ├── FTPService.gloop
        │   ├── GoogleDriveService.gloop
        │   ├── OneDriveService.gloop
        │   ├── S3Service.gloop
        │   └── SFTPService.gloop
        └── util
            └── VFSDemo.gloop

Simply run the services under vfs.services and you should see the files being published. Do note that you must input your credentials to use them. Opening each service allows you to better inspect their contents; line comments are provided for further explanation.

For your benefit, below is a complete list of the VFS services available in the examples package:

VFS Service
Dropbox DropboxService.gloop
FTP FTPService.gloop
Google Drive GoogleDriveService.gloop
One Drive OneDriveService.gloop
RAM RAMService.gloop
Amazon S3 S3Service.gloop
SFTP SFTPService.gloop

How It Works...

vfs.util.VFSDemo.gloop is a generic service that is used by all of the other services in vfs.services. This is the service that directly calls one-liners in VfsMethods.

The other services, named specifically after the virtual file system that is the target of their demonstration, are included to make the calls simpler and provide the models specific to the service which altogether makes the code easier to understand.