@@ -26,6 +26,7 @@ public class Files {
2626 /**
2727 * The constructor for the Files class.
2828 * @param plugin Reference to the main plugin class.
29+ * @since 1.0.0
2930 */
3031 public Files (FoundryConfig config , JavaPlugin plugin ) {
3132 this .plugin = plugin ;
@@ -38,6 +39,7 @@ public Files(FoundryConfig config, JavaPlugin plugin) {
3839 * Creates a file.
3940 * @param path String - Path to the file.
4041 * @return boolean - If the file and directories (if required) were created successfully.
42+ * @since 1.0.0
4143 */
4244 public boolean create (String path ) {
4345 File createFile = new File (this .plugin .getDataFolder (), this .parseFileName (path ));
@@ -63,6 +65,7 @@ public boolean create(String path) {
6365 * Checks if a file exists.
6466 * @param path - Path to the file.
6567 * @return boolean - If the file exists
68+ * @since 1.0.0
6669 */
6770 public boolean exists (String path ) {
6871 File file = new File (this .plugin .getDataFolder (), this .parseFileName (path ));
@@ -73,6 +76,7 @@ public boolean exists(String path) {
7376 * Opens a configuration file.
7477 * @param path String - Path to the file
7578 * @return boolean - If the operation was successful
79+ * @since 1.0.0
7680 */
7781 public boolean load (String path ) {
7882 if (!this .isOpen ()) {
@@ -105,6 +109,7 @@ public boolean load(String path) {
105109 * Opens a configuration file from root (without checking format).
106110 * @param path String - Path to the file
107111 * @return boolean - If the operation was successful
112+ * @since 1.0.0
108113 */
109114 public boolean loadNoReformat (String path ) {
110115 if (!this .isOpen ()) {
@@ -137,6 +142,7 @@ public boolean loadNoReformat(String path) {
137142 * Opens a configuration file from root (without checking format).
138143 * @param file File - Instance of the file.
139144 * @return boolean - If the operation was successful
145+ * @since 1.0.0
140146 */
141147 public boolean loadNoReformat (File file ) {
142148 if (!this .isOpen ()) {
@@ -168,6 +174,7 @@ public boolean loadNoReformat(File file) {
168174 * Deletes a file.
169175 * @param path String - The path of the file
170176 * @return boolean - If the operation was successful
177+ * @since 1.0.0
171178 */
172179 public boolean delete (String path ) {
173180 try {
@@ -184,6 +191,7 @@ public boolean delete(String path) {
184191 * Saves and closes the current configuration file to a custom location.
185192 * @param file String - The file.
186193 * @return boolean - If the operation was successful
194+ * @since 1.0.0
187195 */
188196 public boolean save (File file ) {
189197 if (this .isOpen ()) {
@@ -205,6 +213,7 @@ public boolean save(File file) {
205213 /**
206214 * Saves and closes the current configuration file.
207215 * @return boolean - If the operation was successful
216+ * @since 1.0.0
208217 */
209218 public boolean save () {
210219 if (this .isOpen ()) {
@@ -232,6 +241,7 @@ public boolean save() {
232241 * @param key The location of the value.
233242 * @param value The value to set.
234243 * @return boolean - If the operation was successful
244+ * @since 1.0.0
235245 */
236246 public boolean set (String key , Object value ) {
237247 if (this .isOpen ()) {
@@ -250,6 +260,7 @@ public boolean set(String key, Object value) {
250260 * Gets an object from the configuration file.
251261 * @param key The location of the value.
252262 * @return Object - the value.
263+ * @since 1.0.0
253264 */
254265 public Object get (String key ) {
255266 if (this .isOpen ()) {
@@ -264,6 +275,7 @@ public Object get(String key) {
264275 * Gets a boolean from the configuration file.
265276 * @param key The location of the value.
266277 * @return boolean - the value.
278+ * @since 1.0.0
267279 */
268280 public boolean getBoolean (String key ) {
269281 if (this .isOpen ()) {
@@ -278,6 +290,7 @@ public boolean getBoolean(String key) {
278290 * Gets a string from the configuration file.
279291 * @param key The location of the value.
280292 * @return String - the value.
293+ * @since 1.0.0
281294 */
282295 public String getString (String key ) {
283296 if (this .isOpen ()) {
@@ -292,6 +305,7 @@ public String getString(String key) {
292305 * Gets an integer from the configuration file.
293306 * @param key The location of the value.
294307 * @return int - the value.
308+ * @since 1.0.0
295309 */
296310 public int getInt (String key ) {
297311 if (this .isOpen ()) {
@@ -306,6 +320,7 @@ public int getInt(String key) {
306320 * Gets a double from the configuration file.
307321 * @param key The location of the value.
308322 * @return double - the value.
323+ * @since 1.0.0
309324 */
310325 public double getDouble (String key ) {
311326 if (this .isOpen ()) {
@@ -320,6 +335,7 @@ public double getDouble(String key) {
320335 * Gets a String List from the configuration file.
321336 * @param key The location of the value.
322337 * @return List - the value.
338+ * @since 1.0.0
323339 */
324340 public List <String > getStringList (String key ) {
325341 if (this .isOpen ()) {
@@ -334,6 +350,7 @@ public List<String> getStringList(String key) {
334350 * Gets a List from the configuration file if is root.
335351 * @param deep Should do deep search?
336352 * @return List - the value.
353+ * @since 1.0.0
337354 */
338355 public Set <String > getKeys (boolean deep ) {
339356 if (this .isOpen ()) {
@@ -349,6 +366,7 @@ public Set<String> getKeys(boolean deep) {
349366 * @param section The section of the file.
350367 * @param deep Should do deep search?
351368 * @return List - the value.
369+ * @since 1.0.0
352370 */
353371 public Set <String > getKeys (String section , boolean deep ) {
354372 if (this .isOpen ()) {
@@ -368,6 +386,7 @@ public Set<String> getKeys(String section, boolean deep) {
368386 * Closes the configuration file without saving it.
369387 * Not needed if save() has been used.
370388 * @return boolean - If the operation was successful
389+ * @since 1.0.0
371390 */
372391 public boolean close () {
373392 if (this .isOpen ()) {
@@ -383,6 +402,7 @@ public boolean close() {
383402 /**
384403 * Checks if a file is open.
385404 * @return boolean - If a file is open
405+ * @since 1.0.0
386406 */
387407 public boolean isOpen () {
388408 return this .config != null && this .file != null ;
@@ -392,6 +412,7 @@ public boolean isOpen() {
392412 * Return the location of the player's data file from an instance of the player.
393413 * @param player Player - The player.
394414 * @return The data file URI inside the /plugin/essence folder.
415+ * @since 1.0.0
395416 */
396417 public String playerDataFile (Player player ) {
397418 return "data/players/" +player .getUniqueId ()+".yml" ;
@@ -401,6 +422,7 @@ public String playerDataFile(Player player) {
401422 * Return the location of the player's data file from an instance of the player.
402423 * @param offlinePlayer OfflinePlayer - The player.
403424 * @return The data file URI inside the /plugin/essence folder.
425+ * @since 1.0.0
404426 */
405427 public String playerDataFile (OfflinePlayer offlinePlayer ) {
406428 return "data/players/" +offlinePlayer .getUniqueId ()+".yml" ;
@@ -410,6 +432,7 @@ public String playerDataFile(OfflinePlayer offlinePlayer) {
410432 * Return the location of the player's data file from the player's UUID.
411433 * @param uuid UUID - The player's UUID.
412434 * @return The data file URI inside the /plugin/essence folder.
435+ * @since 1.0.0
413436 */
414437 public String playerDataFile (UUID uuid ) {
415438 return "data/players/" +uuid +".yml" ;
@@ -419,6 +442,7 @@ public String playerDataFile(UUID uuid) {
419442 * Parses the filename to ensure leading slashes are correct.
420443 * @param fileName String - The name of the file to be opened.
421444 * @return The correctly parsed filename.
445+ * @since 1.0.0
422446 */
423447 private String parseFileName (String fileName ) {
424448 if (fileName != null ) {
@@ -437,6 +461,7 @@ private String parseFileName(String fileName) {
437461 * Removes a key and it's associated data.
438462 * @param key String - The item to remove.
439463 * @return If the operation was successful
464+ * @since 1.0.0
440465 */
441466 public boolean remove (String key ) {
442467 if (this .isOpen ()) {
0 commit comments