public class FileLoader extends Object
Constructor and Description |
---|
FileLoader(String ext)
IMPORTANT :
This DOES NOT GUARANTEE to be executed the way expected and should be avoided unless in testing.
|
FileLoader(String ext,
SceneManager manager)
This is same as
FileLoader(String ext) . |
FileLoader(String dir,
String ext)
This is used to make the FileLoader eligible to load the given type of files from the directory given in String format.
|
FileLoader(String dir,
String ext,
SceneManager manager)
|
FileLoader(URL url,
String ext)
This is used to make the FileLoader eligible to load the given type of files from the directory of the URL provides.
|
FileLoader(URL url,
String ext,
SceneManager manager)
This is same as
FileLoader(URL, String) . |
Modifier and Type | Method and Description |
---|---|
List<File> |
collect()
Collects the set of files with the given extension and inside the given directory for the FileLoader.
|
public FileLoader(String ext)
IMPORTANT : This DOES NOT GUARANTEE to be executed the way expected and should be avoided unless in testing. Use another constructor instead. Calling this constructor will create a FileLoader object which can load the type of files of the given extension (ext) from the same package of the class the constructor was called. Ex : If the constructor was called from "Foo.class", this will create a FileLoader which is able to load the specific files from the same directory "Foo.class" file is located.
NOTE : This constructor is specifically created to be used with SceneManager. If used separately, this will not work properly and will be unable to load the files. (Since this uses getStackTrace()[3] argument and if called directly, it should probably be changed to getStackTrace()[1]).
ext
- extension of the type of files needed to be loadedpublic FileLoader(String ext, SceneManager manager)
This is same as FileLoader(String ext)
. The only difference is that this constructor will initialize the
SceneManager property which can be used later (through the given SceneManager object)
ext
- extension of the type of files needed to be loadedmanager
- SceneManager object which is going to access this FileLoader objectpublic FileLoader(URL url, String ext)
This is used to make the FileLoader eligible to load the given type of files from the directory of the URL provides.
Ex : new FileLoader(getClass().getResource("/path/to/file/myfile.fxml")),"fxml")
Will make the FileLoader eligible to load file with ".fxml" extension from the "/path/to/file" directory.
url
- URL of a class to determine the package which needs to be lookup for files to loadext
- extension of the type of files needed to be loadedpublic FileLoader(URL url, String ext, SceneManager manager)
This is same as FileLoader(URL, String)
. The only difference is that this constructor will initialize the
SceneManager property which can be used later (through the given SceneManager object)
url
- URL of a class to determine the package which needs to be lookup for files to loadext
- extension of the type of files needed to be loadedmanager
- SceneManager object which is going to access this FileLoader objectpublic FileLoader(String dir, String ext)
This is used to make the FileLoader eligible to load the given type of files from the directory given in String format.
dir
- directory pathext
- extension of the type of files needed to be loadedpublic FileLoader(String dir, String ext, SceneManager manager)
dir
- directory pathext
- extension of the type of files needed to be loadedmanager
- SceneManager object which is going to access this FileLoader objectCopyright © 2018. All rights reserved.