|
@ -1,3 +1,7 @@ |
|
|
|
|
|
import java.io.FileNotFoundException; |
|
|
|
|
|
import java.io.FileOutputStream; |
|
|
|
|
|
import java.io.IOException; |
|
|
|
|
|
import java.io.ObjectOutputStream; |
|
|
import java.util.ArrayList; |
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -128,6 +132,25 @@ public class CredentialRepository implements CredentialRepositoryInterface{ |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Function for serialization of all Credentials |
|
|
|
|
|
* @param fileName |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
public void serializeObject(String fileName) |
|
|
|
|
|
{ |
|
|
|
|
|
if(fileName.equals("")) return; |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
FileOutputStream file = new FileOutputStream(this.getWorkingDirectory() + fileName + ".claud11"); |
|
|
|
|
|
ObjectOutputStream out = new ObjectOutputStream(file); |
|
|
|
|
|
out.writeObject(this.credentials); |
|
|
|
|
|
} catch (Exception fail) { |
|
|
|
|
|
System.err.println("Serialization failed!"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* helper function to check list size after insertion / deletion |
|
|
* helper function to check list size after insertion / deletion |
|
|
* @return |
|
|
* @return |
|
|