I want to read a content of the directory (paths to the stored files). Let's say this directory is called "/xml-files", where different xml files are stored.
val xml_folder_2 = getClass.getResource("xml-files")
val dir_path = new File(xml_folder_2.getPath)
But the problem is that it returns a null. However, I have the program where everything works (e.g. Paths.get()), but I want to run the program as a jar file, so only getClass.getResources() might be an option (the problem is described here: Java JAR can't find file)
Does someone have an idea how can I get the names of the files inside "xml-files" directory?
Edit 1: For the time being the first line returns a path to the "target" directory that is generated automatically, instead of the path that is stored inside "resources" directory. Maybe that's the problem why I can't list the files inside the directory?