The path of the directory in the file system at which libraries are stored.
Protected
ignoredFiles with this pattern are not returned when listing the directory contents. Can be used by classes extending FileLibraryStorage to hide internals.
Protected
librariesThe path of the directory in the file system at which libraries are stored.
Adds a library file to a library. The library metadata must have been installed with installLibrary(...) first. Throws an error if something unexpected happens.
The library that is being installed
Filename of the file to add, relative to the library root
The stream containing the file content
true if successful
Adds the metadata of the library to the repository. Throws errors if something goes wrong.
The library metadata object (= content of library.json)
True if the library can only be used be users allowed to install restricted libraries.
The newly created library object to use when adding library files with addFile(...)
Removes all files of a library. Doesn't delete the library metadata. (Used when updating libraries.)
the library whose files should be deleted
Removes the library and all its files from the repository. Throws errors if something went wrong.
The library to remove.
Check if the library contains a file
The library to check
true if file exists in library, false otherwise
Counts how often libraries are listed in the dependencies of other libraries and returns a list of the number.
an object with ubernames as key. Example: { 'H5P.Example': 10 } This means that H5P.Example is used by 10 other libraries.
Returns the number of libraries that depend on this (single) library.
the library to check
the number of libraries that depend on this library.
Protected
getGets the directory path of the specified library.
the absolute path to the directory
Protected
getGets the path of any file of the specified library.
the absolute path to the file
Returns a information about a library file. Throws an exception if the file does not exist.
library
the relative path inside the library
the file stats
Returns a readable stream of a library file's contents. Throws an exception if the file does not exist.
library
the relative path inside the library
a readable stream of the file's contents
Returns all installed libraries or the installed libraries that have the machine names.
Optional
machineName: string(optional) only return libraries that have this machine name
the libraries installed
Gets a list of installed language files for the library.
The library to get the languages for
The list of JSON files in the language folder (without the extension .json)
Protected
getGet the base path of the libraries
the base library path
Gets the library metadata (= content of library.json) of the library.
the library
the metadata
Checks if a library is installed in the system.
the library to check
true if installed, false if not
Returns a list of library addons that are installed in the system. Addons are libraries that have the property 'addTo' in their metadata.
Gets a list of all library files that exist for this library.
all files that exist for the library
Updates the additional metadata properties that is added to the stored libraries. This metadata can be used to customize behavior like restricting libraries to specific users.
the library for which the metadata should be updated
the metadata to update
true if the additionalMetadata object contained real changes and if they were successfully saved; false if there were not changes. Throws an error if saving was not possible.
Updates the library metadata. This is necessary when updating to a new patch version. You also need to call clearFiles(...) to remove all old files during the update process and addFile(...) to add the files of the patch.
the new library metadata
The updated library object
Stores libraries in a directory.