use of org.irods.jargon.core.query.CollectionAndDataObjectListingEntry in project metalnx-web by irods-contrib.
the class DataGridUtils method mapListingEntryToDataGridCollectionAndDataObject.
/**
* Maps a CollectionAndDataObjectListingEntry list into a DataGridCollectionAndDataObject list
*
* @param entries
* CollectionAndDataObjectListingEntry objects to map
* @return list of DataGridCollectionAndDataObject objects
*/
public static List<DataGridCollectionAndDataObject> mapListingEntryToDataGridCollectionAndDataObject(List<CollectionAndDataObjectListingEntry> entries) {
logger.debug("Mapping a CollectionAndDataObjectListingEntry list into a " + "DataGridCollectionAndDataObject list");
List<DataGridCollectionAndDataObject> dataGridCollectionAndDataObjects = new ArrayList<DataGridCollectionAndDataObject>();
for (CollectionAndDataObjectListingEntry entry : entries) {
if ("/".equals(entry.getPathOrName()))
continue;
DataGridCollectionAndDataObject dataGridCollectionAndDataObject = mapListingEntryToDataGridCollectionAndDataObject(entry);
dataGridCollectionAndDataObjects.add(dataGridCollectionAndDataObject);
}
return dataGridCollectionAndDataObjects;
}
use of org.irods.jargon.core.query.CollectionAndDataObjectListingEntry in project metalnx-web by irods-contrib.
the class DataGridUtils method mapCollectionQueryResultSetToDataGridObjects.
/**
* Maps the results from the specific query for listing files in a collection into data objects
* for collections
*
* @param queryResultSet
* result set returned from a query
* @return list of data grid objects
* @throws JargonException
*/
public static List<CollectionAndDataObjectListingEntry> mapCollectionQueryResultSetToDataGridObjects(SpecificQueryResultSet queryResultSet) throws JargonException {
List<CollectionAndDataObjectListingEntry> dataGridCollectionAndDataObjects = new ArrayList<CollectionAndDataObjectListingEntry>();
List<IRODSQueryResultRow> results = queryResultSet.getResults();
for (IRODSQueryResultRow irodsQueryResultRow : results) {
CollectionAndDataObjectListingEntry collectionAndDataObject = new CollectionAndDataObjectListingEntry();
collectionAndDataObject.setParentPath(irodsQueryResultRow.getColumn("c.parent_coll_name"));
collectionAndDataObject.setPathOrName(irodsQueryResultRow.getColumn("c.coll_name"));
collectionAndDataObject.setOwnerName(irodsQueryResultRow.getColumn("c.coll_owner_name"));
collectionAndDataObject.setOwnerZone(irodsQueryResultRow.getColumn("c.coll_owner_zone"));
collectionAndDataObject.setObjectType(ObjectType.COLLECTION);
collectionAndDataObject.setCreatedAt(IRODSDataConversionUtil.getDateFromIRODSValue(irodsQueryResultRow.getColumn("c.create_ts")));
collectionAndDataObject.setModifiedAt(IRODSDataConversionUtil.getDateFromIRODSValue(irodsQueryResultRow.getColumn("c.modify_ts")));
dataGridCollectionAndDataObjects.add(collectionAndDataObject);
}
return dataGridCollectionAndDataObjects;
}
use of org.irods.jargon.core.query.CollectionAndDataObjectListingEntry in project metalnx-web by irods-contrib.
the class DataGridUtils method mapQueryResultSetToDataGridObjects.
/**
* Maps the results from the specific query for listing files in a collection into DataGrid
* objects
*
* @param queryResultSet
* @return
* @throws JargonException
*/
public static List<CollectionAndDataObjectListingEntry> mapQueryResultSetToDataGridObjects(SpecificQueryResultSet queryResultSet) throws JargonException {
List<CollectionAndDataObjectListingEntry> dataGridCollectionAndDataObjects = new ArrayList<CollectionAndDataObjectListingEntry>();
List<IRODSQueryResultRow> results = queryResultSet.getResults();
for (IRODSQueryResultRow irodsQueryResultRow : results) {
CollectionAndDataObjectListingEntry collectionAndDataObject = new CollectionAndDataObjectListingEntry();
collectionAndDataObject.setParentPath(irodsQueryResultRow.getColumn("c.coll_name"));
collectionAndDataObject.setPathOrName(irodsQueryResultRow.getColumn("d.data_name"));
collectionAndDataObject.setDataSize(Long.parseLong(irodsQueryResultRow.getColumn("d.data_size")));
collectionAndDataObject.setOwnerName(irodsQueryResultRow.getColumn("d.data_owner_name"));
collectionAndDataObject.setOwnerZone(irodsQueryResultRow.getColumn("d.data_owner_zone"));
collectionAndDataObject.setModifiedAt(IRODSDataConversionUtil.getDateFromIRODSValue(irodsQueryResultRow.getColumn("d.modify_ts")));
dataGridCollectionAndDataObjects.add(collectionAndDataObject);
}
return dataGridCollectionAndDataObjects;
}
Aggregations