2010-02-03 03:29:47 +01:00
|
|
|
package com.metaweb.gridworks;
|
2010-01-25 23:51:25 +01:00
|
|
|
|
|
|
|
import java.io.Serializable;
|
2010-02-01 20:16:09 +01:00
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Properties;
|
2010-01-25 23:51:25 +01:00
|
|
|
|
2010-01-26 06:17:14 +01:00
|
|
|
import org.json.JSONException;
|
2010-02-01 20:16:09 +01:00
|
|
|
import org.json.JSONWriter;
|
2010-01-26 06:17:14 +01:00
|
|
|
|
2010-02-01 20:16:09 +01:00
|
|
|
public class ProjectMetadata implements Serializable, Jsonizable {
|
2010-01-25 23:51:25 +01:00
|
|
|
private static final long serialVersionUID = 7959027046468240844L;
|
|
|
|
|
2010-02-01 20:16:09 +01:00
|
|
|
public String name;
|
|
|
|
public String password;
|
|
|
|
public Date created = new Date();
|
|
|
|
public Date modified = new Date();
|
2010-01-26 06:17:14 +01:00
|
|
|
|
2010-02-01 20:16:09 +01:00
|
|
|
@Override
|
|
|
|
public void write(JSONWriter writer, Properties options)
|
|
|
|
throws JSONException {
|
2010-01-26 06:17:14 +01:00
|
|
|
|
2010-02-01 20:16:09 +01:00
|
|
|
SimpleDateFormat sdf = (SimpleDateFormat) SimpleDateFormat.getDateTimeInstance();
|
2010-01-26 06:17:14 +01:00
|
|
|
|
2010-02-01 20:16:09 +01:00
|
|
|
writer.object();
|
|
|
|
writer.key("name"); writer.value(name);
|
|
|
|
writer.key("created"); writer.value(sdf.format(created));
|
|
|
|
writer.key("modified"); writer.value(sdf.format(modified));
|
|
|
|
writer.endObject();
|
2010-01-26 06:17:14 +01:00
|
|
|
}
|
2010-01-25 23:51:25 +01:00
|
|
|
}
|