From 5410df0011fbf2eea4acd008b3357b809378ad23 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Fri, 18 Oct 2019 18:44:54 +0200 Subject: [PATCH] fix(core): update --- ts/smartbucket.classes.directory.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ts/smartbucket.classes.directory.ts b/ts/smartbucket.classes.directory.ts index ab1ad09..65e6bd7 100644 --- a/ts/smartbucket.classes.directory.ts +++ b/ts/smartbucket.classes.directory.ts @@ -124,6 +124,7 @@ export class Directory { * gets a sub directory */ public async getSubDirectoryByName(dirNameArg: string): Promise { + // TODO: make this recursive const directories = await this.listDirectories(); return directories.find(directory => { return directory.name === dirNameArg; @@ -144,4 +145,20 @@ export class Directory { public async createFile(relativePathArg) { let completeFilePath: string = ''; } + + // file operations + public async fastStore(pathArg: string, contentArg: string) { + const path = plugins.path.join(this.getBasePath(), pathArg); + await this.bucketRef.fastStore(path, contentArg); + } + + public async fastGet(pathArg: string) { + const path = plugins.path.join(this.getBasePath(), pathArg); + await this.bucketRef.fastGet(path); + } + + public async fastRemove(pathArg: string) { + const path = plugins.path.join(this.getBasePath(), pathArg); + await this.bucketRef.fastRemove(path); + } }