"use strict";
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
Object.defineProperty(exports, "__esModule", { value: true });
const FileSystemFolder_1 = require("./FileSystemFolder");
const StorageBase_1 = require("./StorageBase");
class FileSystemStorage extends StorageBase_1.default {
    rootFolder;
    static fileSystemFolderDelimiter = "/";
    get folderDelimiter() {
        return FileSystemStorage.fileSystemFolderDelimiter;
    }
    constructor(handle, name) {
        super();
        this.rootFolder = new FileSystemFolder_1.default(this, null, "", name ? name : "root", handle);
    }
    joinPath(pathA, pathB) {
        let fullPath = pathA;
        if (!fullPath.endsWith(FileSystemStorage.fileSystemFolderDelimiter)) {
            fullPath += FileSystemStorage.fileSystemFolderDelimiter;
        }
        fullPath += pathB;
        return fullPath;
    }
    static getParentFolderPath(path) {
        const lastDelim = path.lastIndexOf(this.fileSystemFolderDelimiter);
        if (lastDelim < 0) {
            return path;
        }
        return path.substring(0, lastDelim);
    }
}
exports.default = FileSystemStorage;

//# sourceMappingURL=../maps/storage/FileSystemStorage.js.map
