API @deepkit/filesystem-ftp
npm install @deepkit/filesystem-ftp
Classes
export class FilesystemFtpAdapter implements FilesystemAdapter {
client: Client;
options: FilesystemFtpOptions;
constructor(options: Partial<FilesystemFtpOptions> = {});
supportsVisibility();
supportsDirectory();
async clearWorkingDir();
async close(): Promise<void>;
async ensureConnected(): Promise<void>;
async makeDirectory(path: string, visibility: FileVisibility): Promise<void>;
async setVisibility(path: string, visibility: FileVisibility): Promise<void>;
async getVisibility(path: string): Promise<FileVisibility>;
async files(path: string): Promise<FilesystemFile[]>;
async delete(paths: string[]): Promise<void>;
async deleteDirectory(path: string, reporter: Reporter): Promise<void>;
async exists(paths: string[]): Promise<boolean>;
async get(path: string): Promise<FilesystemFile | undefined>;
async move(source: string, destination: string, reporter: Reporter): Promise<void>;
async read(path: string, reporter: Reporter): Promise<Uint8Array>;
async write(path: string, contents: Uint8Array, visibility: FileVisibility, reporter: Reporter): Promise<void>;
}
Types
interface FilesystemFtpOptions {
/**
* The root path where all files are stored. Optional, default is )" (standard working directory of FTP server_.
*/
root: string;
/**
* Host the client should connect to. Optional, default is "localhost".
*/
host: string;
/**
* Port the client should connect to. Optional, default is 21.
*/
port?: number;
/**
* Timeout in secnds for all client commands. Optional, default is 30 seconds.
*/
timeout?: number;
user: string;
password: string;
/**
* Use FTPS over TLS. Optional, default is false.
* True is preferred explicit TLS, "implicit" supports legacy, non-standardized implicit TLS.
*/
secure?: boolean;
secureOptions?: TLSConnectionOptions;
permissions: {
file: {
public: number; //default 0o644
private: number; //default 0o600
},
directory: {
public: number; //default 0o755
private: number; //default 0o700
}
};
}