2013-02-06 15:40:17 +01:00
|
|
|
package org.gcube.portlets.user.workspace.client.model;
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
import org.gcube.portlets.user.workspace.client.ConstantsExplorer;
|
|
|
|
|
|
|
|
/**
|
2013-11-15 12:12:17 +01:00
|
|
|
*
|
2013-02-06 15:40:17 +01:00
|
|
|
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
2013-11-15 12:12:17 +01:00
|
|
|
* @Nov 14, 2013
|
2013-02-06 15:40:17 +01:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
public class FileGridModel extends FileModel {
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
|
|
|
protected FileGridModel(){
|
|
|
|
}
|
|
|
|
|
2013-11-15 12:12:17 +01:00
|
|
|
public FileGridModel(String identifier, String name, String path, Date lastUpdate, FileModel parent, long size, boolean isDirectory, boolean isShared) {
|
2013-02-06 15:40:17 +01:00
|
|
|
super(identifier, name, parent, isDirectory, isShared);
|
|
|
|
|
2013-11-15 12:12:17 +01:00
|
|
|
setLastModification(lastUpdate);
|
2013-02-06 15:40:17 +01:00
|
|
|
setSize(size);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-11-15 12:12:17 +01:00
|
|
|
public FileGridModel(String identifier, String name, Date lastUpdate, FileModel parent, long size, boolean isDirectory, boolean isShared) {
|
2013-02-06 15:40:17 +01:00
|
|
|
super(identifier, name, parent, isDirectory, isShared);
|
|
|
|
|
2013-11-15 12:12:17 +01:00
|
|
|
setLastModification(lastUpdate);
|
2013-02-06 15:40:17 +01:00
|
|
|
setSize(size);
|
|
|
|
}
|
|
|
|
|
|
|
|
private void setSize(long size) {
|
|
|
|
set(ConstantsExplorer.SIZE, size);
|
|
|
|
}
|
|
|
|
|
|
|
|
public long getSize() {
|
|
|
|
return (Long) get(ConstantsExplorer.SIZE);
|
|
|
|
}
|
|
|
|
|
2013-11-15 12:12:17 +01:00
|
|
|
// private void setCreationDate(Date creationDate) {
|
|
|
|
// set(ConstantsExplorer.GRIDCOLUMNCREATIONDATE, creationDate);
|
|
|
|
//
|
|
|
|
// }
|
|
|
|
|
|
|
|
private void setLastModification(Date lastUpdate) {
|
|
|
|
set(ConstantsExplorer.LASTMODIFIED, lastUpdate);
|
2013-02-06 15:40:17 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-11-15 12:12:17 +01:00
|
|
|
public Date getLastModification() {
|
|
|
|
return (Date) get(ConstantsExplorer.LASTMODIFIED);
|
|
|
|
|
2013-02-06 15:40:17 +01:00
|
|
|
}
|
|
|
|
|
2013-11-15 12:12:17 +01:00
|
|
|
// public Date getCreationDate(){
|
|
|
|
// return (Date) get(ConstantsExplorer.GRIDCOLUMNCREATIONDATE);
|
|
|
|
// }
|
|
|
|
|
2013-02-06 15:40:17 +01:00
|
|
|
@Override
|
|
|
|
public boolean equals(Object obj) {
|
|
|
|
if (obj != null && obj instanceof FileGridModel) {
|
|
|
|
FileGridModel mobj = (FileGridModel) obj;
|
|
|
|
return getIdentifier().equals(mobj.getIdentifier());
|
|
|
|
}
|
|
|
|
return super.equals(obj);
|
|
|
|
}
|
|
|
|
}
|