Package org.sqlproc.engine
Class SqlFilesLoader
java.lang.Object
org.sqlproc.engine.SqlFilesLoader
The helper class for the file(s) loading. The file(s) can be located on the classpath, in the root directory or in
the user's home directory. It's used for the purpose of the
SqlProcessorLoader
instance creation.
For more info please see the Tutorials.
- Author:
- Vladimir Hudec
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.slf4j.Logger
The internal slf4j logger.private StringBuilder
The string representation of the file(s) content. -
Constructor Summary
ConstructorsConstructorDescriptionSqlFilesLoader
(String fileName, Class<?> loaderClass) Reads the file(s) content and creates a new SqlFilesLoader instance.SqlFilesLoader
(List<String> fileNames, Class<?> loaderClass) Reads the file(s) content and creates a new SqlFilesLoader instance. -
Method Summary
Modifier and TypeMethodDescriptionReturns the content of all read files.static StringBuilder
getStatements
(Class<?> loaderClass, String fileName) Reads the file(s) content and creates a new SqlFilesLoader instance.static StringBuilder
getStatements
(Class<?> loaderClass, String... fileNames) Reads the file(s) content and creates a new SqlFilesLoader instance.private StringBuilder
Reads the file content and creates a String representation of this content.toString()
Returns a string representation of the object.
-
Field Details
-
logger
protected final org.slf4j.Logger loggerThe internal slf4j logger. -
sbStatements
The string representation of the file(s) content.
-
-
Constructor Details
-
SqlFilesLoader
Reads the file(s) content and creates a new SqlFilesLoader instance.- Parameters:
fileName
- The name of the file to be read.loaderClass
- Class used to detect the correct classloader.
-
SqlFilesLoader
Reads the file(s) content and creates a new SqlFilesLoader instance.- Parameters:
fileNames
- The names of the files to be read.loaderClass
- Class used to detect the correct classloader.
-
-
Method Details
-
getStatements
Reads the file(s) content and creates a new SqlFilesLoader instance.- Parameters:
loaderClass
- Class used to detect the correct classloader.fileName
- The name of the file to be read.- Returns:
- the content of the specified file(s) as a String
-
getStatements
Reads the file(s) content and creates a new SqlFilesLoader instance.- Parameters:
loaderClass
- Class used to detect the correct classloader.fileNames
- The name sof the files to be read.- Returns:
- the content of the specified file(s) as a String
-
load
Reads the file content and creates a String representation of this content.- Parameters:
fileName
- The name of the file to be read.loaderClass
- Class used to detect the correct classloader.- Returns:
- the content of the specified file as a String
-
getStatements
Returns the content of all read files.- Returns:
- the content of all read files
-
toString
Returns a string representation of the object.
-