workspace/CustomStructuresAPI/src/work/mgnet/customstructuresapi/CustomStructuresAPI.java
public void saveConfiguration() {
		try {
			if (!getDataFolder().exists()) getDataFolder().mkdir(); // Create Data Folder if it doesn't exist
			if (!new File(getDataFolder(), "spawned.yml").exists()) new File(getDataFolder(), "spawned.yml").createNewFile(); // Create File if it doesn't exist
			PrintWriter pw = new PrintWriter(new File(getDataFolder(), "spawned.yml")); // Clear File 
			pw.write(""); // by writing an empty string
			pw.close(); // Closing File
			ObjectOutputStream objectWriter = new ObjectOutputStream(new FileOutputStream(new File(getDataFolder(), "spawned.yml"))); // Open Object Writer
			objectWriter.writeObject(StructureSpawner.placedStructures); // Write Objects
			objectWriter.close(); // Close File
		} catch (Exception e) {
			this.getLogger().info("Could not save the File."); // Error
		}
	}
// Method is used to Save the File
Method is used to Save the File
Method is used to Save the File
public void saveConfiguration() {
		try {
			if (!getDataFolder().exists()) getDataFolder().mkdir(); 
			if (!new File(getDataFolder(), "spawned.yml").exists()) new File(getDataFolder(), "spawned.yml").createNewFile(); 
			PrintWriter pw = new PrintWriter(new File(getDataFolder(), "spawned.yml")); 
			pw.write(""); 
			pw.close(); 
			ObjectOutputStream objectWriter = new ObjectOutputStream(new FileOutputStream(new File(getDataFolder(), "spawned.yml"))); 
			objectWriter.writeObject(StructureSpawner.placedStructures); 
			objectWriter.close(); 
		} catch (Exception e) {
			this.getLogger().info("Could not save the File."); 
		}
	}
public void saveConfiguration ( ) { try { if ( ! getDataFolder ( ) . exists ( ) ) getDataFolder ( ) . mkdir ( ) ; if ( ! new File ( getDataFolder ( ) , "spawned.yml" ) . exists ( ) ) new File ( getDataFolder ( ) , "spawned.yml" ) . createNewFile ( ) ; PrintWriter pw = new PrintWriter ( new File ( getDataFolder ( ) , "spawned.yml" ) ) ; pw . write ( "" ) ; pw . close ( ) ; ObjectOutputStream objectWriter = new ObjectOutputStream ( new FileOutputStream ( new File ( getDataFolder ( ) , "spawned.yml" ) ) ) ; objectWriter . writeObject ( StructureSpawner . placedStructures ) ; objectWriter . close ( ) ; } catch ( Exception e ) { this . getLogger ( ) . info ( "Could not save the File." ) ; } }
Method is used to Save the File
Method is used to Save the File
// Create Data Folder if it doesn't exist // Create File if it doesn't exist // Clear File  // by writing an empty string // Closing File // Open Object Writer // Write Objects // Close File // Error