Closed Java4Life17 closed 4 years ago
it does not return the file name. it's for the current section's name.
Use yamlFile.getConfigurationFile().getName()
to get the file name, or yamlFile.getFilePath()
to get the absolute path.
getName
is a method of ConfigurationSection
([docs](https://carleslc.me/Simple-YAML/doc/Simple-Configuration/org/simpleyaml/configuration/ConfigurationSection.html#getName())) that returns the name of the configuration section. YamlFile
implements ConfigurationSection
(is the file's root section), so yamlFile.getName()
returns the same as yamlFile.getRoot().getName()
, which is blank because root path is blank (yamlFile.getCurrentPath()
is blank too, for the same reason).
For instance, yamlFile.getConfigurationSection("test").getName()
will return test
.
When ever I try to get a File name with file.getName(); it returns nothing.