Interface DelphiResources
- 
Method Summary
Modifier and TypeMethodDescriptioncreateDirectoryModule(@NotNull Path path) Create a directory module with the specifiedpathas the directory.createZipModule(@NotNull Path zipPath) Create a zip module from the specifiedzipPath.findModule(String moduleName) Attempts to locate a module.Gets the module directory.Gets an array list of all module names.booleanregisterModule(@NotNull String moduleName, @NotNull ResourceModule module) Registers a module.booleanunregisterModule(@Nullable String moduleName) Unregisters a module 
- 
Method Details
- 
getModuleDirectory
Path getModuleDirectory()Gets the module directory.The returned path is the
modulesdirectory inside the Delphi plugin's data folder.- Returns:
 - Module directory
 
 - 
createDirectoryModule
Create a directory module with the specifiedpathas the directory.- Parameters:
 path- Directory path- Returns:
 - Created module.
 - Throws:
 NullPointerException- Ifpathisnull
 - 
createZipModule
Create a zip module from the specifiedzipPath.This method will attempt to immediately open and read the zip file into memory, and will return an erroneous result if it fails to do so for any reason.
Error messages Format Description "No Such File"zipPathfile doesn't exist"Access Denied: %reason%"Read access was denied to the zip file "IO Error: %message%"Threw an IOException- Parameters:
 zipPath- Zip file path- Returns:
 - A successful result if the zip archive was opened, otherwise an erroneous result.
 - Throws:
 NullPointerException- IfzipPathisnull
 - 
registerModule
boolean registerModule(@NotNull @NotNull String moduleName, @NotNull @NotNull ResourceModule module) Registers a module.This method will return
falseif another module has already been registered with the specifiedmoduleName.- Parameters:
 moduleName- Name of the module.module- Module.- Returns:
 true, if the module was registered,false, if the specified name is already in use.- Throws:
 NullPointerException- If eithermoduleNameormoduleisnull.IllegalArgumentException- If the module name doesn't pass theResourcePath.validateQuery(String)check.
 - 
unregisterModule
Unregisters a moduleWhen a module is unregistered, all pages open to the specified module are closed as well.
This method only unregisters modules that were registered with the
registerModule(String, ResourceModule)method. Any modules inside thegetModuleDirectory()cannot be unregistered.- Parameters:
 moduleName- Module name- Returns:
 trueif a module with themoduleNamewas found and was removed,falseotherwise.
 - 
findModule
Attempts to locate a module.This will first attempt to find a module registered with
registerModule(String, ResourceModule). No registered module is found, it will attempt to find a directory or a zip archive with the specified name.This method assumes the input has no file extension.
Result errors Error code Description ERR_EMPTY_MODULE_NAMEThe module name was empty or nullERR_MODULE_DIRECTORY_NOT_FOUNDCouldn't find any registered modules matching the name, and the module directory doesn't exist ERR_MODULE_ZIP_ACCESS_DENIEDAttempted to open a .zipmodule file, but access was deniedERR_IO_ERRORAn IO error occurred while trying to read a .zipmodule fileERR_MODULE_UNKNOWNNo registered module, directory or .zipmodule was found that matched the specifiedmoduleName- Parameters:
 moduleName- Name of the module- Returns:
 - Found module, or an erroneous result if no module was found.
 
 - 
getModuleNames
Gets an array list of all module names. This list inclues all registered modules as well as all directory and zip archive modules installed ingetModuleDirectory()- Returns:
 - Module name list.
 
 
 -