FileManager

A class dedicated for handling files and directories This class is responsible for managing project folders, copying files from source to build folders.

Author

Sujal Choudhari sujalchoudhari@gmail.com

Hierarchy

  • FileManager
=======
  • Defined in filemanager.ts:11
  • >>>>>>> origin/dev =======
  • Defined in filemanager.ts:12
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:12
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:12
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:12
  • >>>>>>> dev:docs/classes/index.FileManager.html =======
  • Defined in utils/filemanager.ts:12
  • >>>>>>> dev

    Properties

    basePath: string

    Absolute path to current working directory

    =======
  • Defined in filemanager.ts:15
  • >>>>>>> origin/dev =======
  • Defined in filemanager.ts:16
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:16
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:16
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:16
  • >>>>>>> dev:docs/classes/index.FileManager.html =======
  • Defined in utils/filemanager.ts:16
  • >>>>>>> dev

    Constructors

    • Creare a new instance of FileManager While creating a new instance of FileManager, base path will be automatically set to the current working directory.

      Parameters

      • basepath: string = ""

      Returns FileManager

    =======
  • Defined in filemanager.ts:22
  • >>>>>>> origin/dev =======
  • Defined in filemanager.ts:23
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:23
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:23
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:23
  • >>>>>>> dev:docs/classes/index.FileManager.html =======
  • Defined in utils/filemanager.ts:23
  • >>>>>>> dev

    Methods

    • Convert relative path to absolute path

      Returns

      The abosolute path of the file or directory.

      Deprecated

      No not use this method. Will be removed in future versions

      Parameters

      • relativePath: string

        The relative path of any file or directory

      Returns string

    =======
  • Defined in filemanager.ts:31
  • >>>>>>> origin/dev =======
  • Defined in filemanager.ts:32
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:34
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:34
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:34
  • >>>>>>> dev:docs/classes/index.FileManager.html =======
  • Defined in utils/filemanager.ts:35
  • >>>>>>> dev
    • Read a file synchronously

      Returns

      the contents of the file or directory. nullif file is not found

      Parameters

      • path: string

        relative path of the file or directory

      Returns null | string

    =======
  • Defined in filemanager.ts:40
  • >>>>>>> origin/dev =======
  • Defined in filemanager.ts:41
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:43
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:43
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:43
  • >>>>>>> dev:docs/classes/index.FileManager.html =======
  • Defined in utils/filemanager.ts:44
  • >>>>>>> dev
    • Create a new directory

      Parameters

      • path: string

        Path at which the directory should be created. The name of the directory should be included in the path

      Returns void

    =======
  • Defined in filemanager.ts:57
  • >>>>>>> origin/dev =======
  • Defined in filemanager.ts:61
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:63
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:63
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:63
  • >>>>>>> dev:docs/classes/index.FileManager.html =======
  • Defined in utils/filemanager.ts:63
  • >>>>>>> dev
    • Copy the directory from source to destination

      Parameters

      • srcPath: string

        THe source path of the directory

      • destPath: string

        the final destination path

      Returns void

    =======
  • Defined in filemanager.ts:67
  • >>>>>>> origin/dev =======
  • Defined in filemanager.ts:71
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:73
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:73
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:73
  • >>>>>>> dev:docs/classes/index.FileManager.html =======
  • Defined in utils/filemanager.ts:72
  • >>>>>>> dev
    • Get a list of names of files and in the directory and its subdirectories.

      Returns

      A List of the names (absolute paths)

      Author

      Ansh Sharma

      Parameters

      • directoryPath: string

        The path to the directory to get the names from

      Returns string[]

    =======
  • Defined in filemanager.ts:97
  • >>>>>>> origin/dev =======
  • Defined in filemanager.ts:102
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:104
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:104
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:104
  • >>>>>>> dev:docs/classes/index.FileManager.html =======
  • Defined in utils/filemanager.ts:100
  • >>>>>>> dev
    • Move a file from one directory to another

      Parameters

      • srcPath: string

        Source path

      • destPath: string

        Destination path

      Returns void

    =======
  • Defined in filemanager.ts:125
  • >>>>>>> origin/dev =======
  • Defined in filemanager.ts:131
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:133
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:133
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:133
  • >>>>>>> dev:docs/classes/index.FileManager.html =======
  • Defined in utils/filemanager.ts:128
  • >>>>>>> dev
    • Copy a file to a destination

      Parameters

      • srcPath: string

        Source file path

      • destPath: string

        Destination file path

      • srcPathType: "absolute" | "relative" = "relative"

        The type of the source path, relative or absolute. Default is relative

      Returns void

    =======
  • Defined in filemanager.ts:141
  • >>>>>>> origin/dev =======
  • Defined in filemanager.ts:148
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:150
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:150
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:151
  • >>>>>>> dev:docs/classes/index.FileManager.html =======
  • Defined in utils/filemanager.ts:143
  • >>>>>>> dev
    • Create a new file at the specified path

      Parameters

      • filePath: string

        New File Path, the name of file should be included in the path.

      • contents: string

        The contents of the file to create with.

      Returns void

    =======
  • Defined in filemanager.ts:156
  • =======
  • Defined in filemanager.ts:164
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:166
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:166
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:168
  • >>>>>>> dev:docs/classes/index.FileManager.html =======
  • Defined in utils/filemanager.ts:166
  • >>>>>>> dev
    >>>>>>> origin/dev =======
  • Defined in filemanager.ts:175
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:177
  • =======
  • Defined in utils/filemanager.ts:177
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:183
  • >>>>>>> dev:docs/classes/index.FileManager.html =======
  • Defined in utils/filemanager.ts:180
  • >>>>>>> dev
    >>>>>>> dev =======
  • Defined in utils/filemanager.ts:205
  • >>>>>>> dev =======
  • Defined in utils/filemanager.ts:211
  • >>>>>>> dev:docs/classes/index.FileManager.html =======
  • Defined in utils/filemanager.ts:208
  • >>>>>>> dev