}
}
// TODO [low] This should be private; but it has to be public for a test
public FileVersion createFileVersionFromRow(ResultSet resultSet) throws SQLException {
FileVersion fileVersion = new FileVersion();
fileVersion.setFileHistoryId(FileHistoryId.parseFileId(resultSet.getString("filehistory_id")));
fileVersion.setVersion(resultSet.getLong("version"));
fileVersion.setPath(resultSet.getString("path"));
fileVersion.setType(FileType.valueOf(resultSet.getString("type")));
fileVersion.setStatus(FileStatus.valueOf(resultSet.getString("status")));
fileVersion.setSize(resultSet.getLong("size"));
fileVersion.setLastModified(new Date(resultSet.getTimestamp("lastmodified").getTime()));
if (resultSet.getString("linktarget") != null) {
fileVersion.setLinkTarget(resultSet.getString("linktarget"));
}
if (resultSet.getString("filecontent_checksum") != null) {
FileChecksum fileChecksum = FileChecksum.parseFileChecksum(resultSet.getString("filecontent_checksum"));
fileVersion.setChecksum(fileChecksum);
}
if (resultSet.getString("updated") != null) {
fileVersion.setUpdated(new Date(resultSet.getTimestamp("updated").getTime()));
}
if (resultSet.getString("posixperms") != null) {
fileVersion.setPosixPermissions(resultSet.getString("posixperms"));
}
if (resultSet.getString("dosattrs") != null) {
fileVersion.setDosAttributes(resultSet.getString("dosattrs"));
}
return fileVersion;
}