com.alachisoft.ncache.licensing.FileLicenseSink Maven / Gradle / Ivy
Show all versions of nc-activate Show documentation
package com.alachisoft.ncache.licensing;
/**
* ***********************************************************************
* Author: Hasan Khan Date created: 06-05-2008
*
* Modified By: Last modified by: Date modified:
* /************************************************************************
*/
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//#if NCPEX
//#else
//#endif
public class FileLicenseSink implements ILicenseSink {
private String file;
public FileLicenseSink(String file) {
this.file = file;
}
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
///#region ILicenseSink Members
public final java.util.ArrayList Load() {
// java.io.File info = new java.io.File(file);
// if (info.exists() && info.length() > 0)
// {
////C# TO JAVA CONVERTER NOTE: The following 'using' block is replaced by its Java equivalent:
//// using (FileStream stream = File.OpenRead(file))
// FileStream stream = File.OpenRead(file);
// try
// {
// BinaryFormatter formatter = new BinaryFormatter();
// java.util.ArrayList licenses = (java.util.ArrayList) formatter.deserialize(stream);
// return licenses;
// }
// finally
// {
// stream.dispose();
// }
// }
// else
// {
return new java.util.ArrayList();
// }
}
public final void Dump(java.util.ArrayList licenses) {
//C# TO JAVA CONVERTER NOTE: The following 'using' block is replaced by its Java equivalent:
// using (FileStream stream = File.OpenWrite(file))
// FileStream stream = File.OpenWrite(file);
// try
// {
// BinaryFormatter formatter = new BinaryFormatter();
// formatter.serialize(stream, licenses);
// }
// finally
// {
// stream.dispose();
// }
}
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
///#endregion
}