Resources Provider

The ResourcesProvider class is useful to create the resources directories and manage the main resources files such as the properties for the server

Author

N7ghtm4r3 - Tecknobit

Constructors

Link copied to clipboard
constructor(containerDirectory: String)
Constructor to init the ResourcesProvider class
constructor(containerDirectory: String, subDirectories: List<String>)
Constructor to init the ResourcesProvider class

Properties

Link copied to clipboard
protected val containerDirectory: String
containerDirectory the main container directory to create
Link copied to clipboard
protected open var containers: HashSet<String>
containers the set of the containers folder which contains other subfolders to store the resources
Link copied to clipboard
val CUSTOM_CONFIGURATION_FILE_PATH: String = "custom.properties"
CUSTOM_CONFIGURATION_FILE_PATH the path of the custom server configuration file
Link copied to clipboard
val DEFAULT_CONFIGURATION_FILE_PATH: String = "app.properties"
DEFAULT_CONFIGURATION_FILE_PATH the default path where find the default server configuration
Link copied to clipboard
protected val subDirectories: List<String>
subDirectories the subdirectories of the containerDirectory folder

Functions

Link copied to clipboard
Method to create the containerDirectory No-any params required
open fun createContainerDirectory(containerDirectory: String)
Method to create a new container directory
Link copied to clipboard
private open fun createResourceDirectory(resDirectory: String)
Method to create a new resource directory
Link copied to clipboard
Method to create the list of the subDirectories for the containerDirectory No-any params required
open fun createSubDirectories(containerDirectory: String, subDirectories: List<String>)
Method to create the list of the subDirectories for a container directory
Link copied to clipboard
open fun createSubDirectory(subDirectory: String)
Method to create a new subdirectory for the containerDirectory
open fun createSubDirectory(containerDirectory: String, subDirectory: String)
Method to create a new subdirectory
Link copied to clipboard
private open fun formatDirectory(directory: String): String
Method to format the pathname of a directory
Link copied to clipboard
Method to get containers instance No-any params required
Link copied to clipboard
private open fun printError(directory: String)
Method to print the error occurred during the creation of a resources directory