}
public static FilePersistence convert(FileDescriptor file){
if(file==null){
return null;
}
FilePersistence persistence=new FilePersistence();
persistence.setContent(file.getContent());
persistence.setId(file.getId()==null?null:Long.valueOf(file.getId()));
persistence.setName(file.getName());
persistence.setOwner(file.getOwner());
persistence.setParent(file.getParent()==null?null:Long.valueOf(file.getParent()));
persistence.setType(file.isFolder()?FilePersistence.FOLDER:FilePersistence.FILE);
persistence.setGmtCreate(file.getGmtCreate());
persistence.setGmtModified(file.getGmtModified());
return persistence;
}