package jfdi.storage;

import jfdi.storage.exceptions.ExistingFilesFoundException;
import jfdi.storage.exceptions.InvalidPathException;

/**
 * The Storage interface serves as the facade of the Storage component. It
 * allows the storage folder path to be initialized/changed.
 *
 * @author Thng Kai Yuan
 */
public interface IStorage {

	/**
	 * This method loads any existing data from the given storageFolderPath. If
	 * no existing data is found, Storage is initialized with no data. If an
	 * invalid file is found at the given location, the invalid file will be
	 * renamed and kept as a backup while a new file will overwrite the existing
	 * invalid file.
	 *
	 * @param storageFolderPath
	 *            the absolute path of the directory that data is to be loaded
	 *            from and saved to
	 * @throws InvalidPathException
	 *             if the program does not have sufficient permissions to carry
	 *             out file operations in storageFolderPath
	 * @throws ExistingFilesFoundException
	 *             if existing unrecognized data files are found and replaced
	 *             (with backups made) in the given storageFolderPath
	 */
	void load(String storageFolderPath) throws InvalidPathException, ExistingFilesFoundException;

	/**
	 * This method can only be executed after load has been executed. It
	 * transfers existing data in the current storage folder path into the new
	 * storage folder path. The old files are then deleted upon a successful
	 * transfer.
	 *
	 * @param newStorageFolderPath
	 *            the absolute path of the directory that data is to be
	 *            transferred to
	 * @throws InvalidPathException
	 *             if the program does not have sufficient permissions to carry
	 *             out file operations in newStorageFolderPath
	 * @throws ExistingFilesFoundException
	 *             if existing files had to be replaced (with backups made) in
	 *             the newStorageFolderPath
	 */
	void changeDirectory(String newStorageFolderPath) throws InvalidPathException, ExistingFilesFoundException;

}

@@ -331,22 +331,28 @@
 rage %7B%0A%0A
-%09/**%0A%09
+    /**%0A    
  * This 
@@ -419,17 +419,20 @@
 ath. If%0A
-%09
+    
  * no ex
@@ -496,17 +496,20 @@
 . If an%0A
-%09
+    
  * inval
@@ -573,17 +573,20 @@
 will be%0A
-%09
+    
  * renam
@@ -654,17 +654,20 @@
 xisting%0A
-%09
+    
  * inval
@@ -675,21 +675,27 @@
 d file.%0A
-%09 *%0A%09
+     *%0A    
  * @para
@@ -706,33 +706,36 @@
 orageFolderPath%0A
-%09
+    
  *            th
@@ -793,17 +793,20 @@
  loaded%0A
-%09
+    
  *      
@@ -825,25 +825,28 @@
 nd saved to%0A
-%09
+    
  * @throws I
@@ -857,33 +857,36 @@
 idPathException%0A
-%09
+    
  *             i
@@ -937,33 +937,36 @@
 ssions to carry%0A
-%09
+    
  *             o
@@ -997,33 +997,36 @@
 orageFolderPath%0A
-%09
+    
  * @throws Exist
@@ -1040,33 +1040,36 @@
 sFoundException%0A
-%09
+    
  *             i
@@ -1126,17 +1126,20 @@
 eplaced%0A
-%09
+    
  *      
@@ -1192,30 +1192,36 @@
 eFolderPath%0A
-%09 */%0A%09
+     */%0A    
 void load(St
@@ -1307,14 +1307,20 @@
 n;%0A%0A
-%09/**%0A%09
+    /**%0A    
  * T
@@ -1384,17 +1384,20 @@
 ted. It%0A
-%09
+    
  * trans
@@ -1463,17 +1463,20 @@
 the new%0A
-%09
+    
  * stora
@@ -1540,17 +1540,20 @@
 cessful%0A
-%09
+    
  * trans
@@ -1561,13 +1561,19 @@
 er.%0A
-%09 *%0A%09
+     *%0A    
  * @
@@ -1599,17 +1599,20 @@
 derPath%0A
-%09
+    
  *      
@@ -1671,17 +1671,20 @@
 s to be%0A
-%09
+    
  *      
@@ -1704,17 +1704,20 @@
 rred to%0A
-%09
+    
  * @thro
@@ -1732,33 +1732,36 @@
 idPathException%0A
-%09
+    
  *             i
@@ -1820,17 +1820,20 @@
 o carry%0A
-%09
+    
  *      
@@ -1883,17 +1883,20 @@
 derPath%0A
-%09
+    
  * @thro
@@ -1926,17 +1926,20 @@
 ception%0A
-%09
+    
  *      
@@ -2005,17 +2005,20 @@
 ade) in%0A
-%09
+    
  *      
@@ -2053,14 +2053,20 @@
 ath%0A
-%09 */%0A%09
+     */%0A    
 void

Convert tabs to spaces