Search in sources :

Example 1 with GetCSVGridResult

use of edu.stanford.bmir.protege.web.shared.csv.GetCSVGridResult in project webprotege by protegeproject.

the class GetCSVGridActionHandler method execute.

@Nonnull
@Override
public GetCSVGridResult execute(@Nonnull GetCSVGridAction action, @Nonnull ExecutionContext executionContext) {
    DocumentId documentId = action.getCSVDocumentId();
    File file = new File(uploadsDirectory, documentId.getDocumentId());
    if (!file.exists()) {
        throw new RuntimeException("CSV file does not exist");
    }
    CSVGrid grid = getCSVGrid(file, action.getRowLimit());
    return new GetCSVGridResult(grid);
}
Also used : GetCSVGridResult(edu.stanford.bmir.protege.web.shared.csv.GetCSVGridResult) DocumentId(edu.stanford.bmir.protege.web.shared.csv.DocumentId) CSVGrid(edu.stanford.bmir.protege.web.shared.csv.CSVGrid) Nonnull(javax.annotation.Nonnull)

Aggregations

CSVGrid (edu.stanford.bmir.protege.web.shared.csv.CSVGrid)1 DocumentId (edu.stanford.bmir.protege.web.shared.csv.DocumentId)1 GetCSVGridResult (edu.stanford.bmir.protege.web.shared.csv.GetCSVGridResult)1 Nonnull (javax.annotation.Nonnull)1