Package edu.stanford.bmir.protege.web.shared.csv

Examples of edu.stanford.bmir.protege.web.shared.csv.CSVGrid$Builder


        return ImportCSVFileAction.class;
    }

    @Override
    protected ChangeListGenerator<Integer> getChangeListGenerator(ImportCSVFileAction action, OWLAPIProject project, ExecutionContext executionContext) {
        CSVGrid csvGrid = parseCSVGrid(action);
        return new ImportCSVFileChangeListGenerator(action.getImportRootClass(), csvGrid, action.getDescriptor());
    }
View Full Code Here


    private CSVGrid parseCSVGrid(ImportCSVFileAction action) {
        try {
            CSVGridParser parser = new CSVGridParser();
            final File file = new File(FileUploadConstants.UPLOADS_DIRECTORY, action.getDocumentId().getDocumentId());
            final BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "utf-8"));
            CSVGrid grid = parser.readAll(reader);
            reader.close();
            return grid;
        }
        catch (IOException e) {
            throw new RuntimeException(e);
View Full Code Here

        DocumentId documentId = action.getCSVDocumentId();
        File file = new File(FileUploadConstants.UPLOADS_DIRECTORY, documentId.getDocumentId());
        if(!file.exists()) {
            throw new RuntimeException("CSV file does not exist");
        }
        CSVGrid grid = getCSVGrid(file, action.getRowLimit());
        return new GetCSVGridResult(grid);

    }
View Full Code Here

        return new GetCSVGridResult(grid);

    }

    private CSVGrid getCSVGrid(File file, int rowLimit) {
        CSVGrid grid;
        try {
            Reader fileReader = new BufferedReader(new InputStreamReader(new FileInputStream(file), "utf-8"));
            CSVGridParser gridParser = new CSVGridParser();
            grid = gridParser.readToLimit(fileReader, rowLimit);
            fileReader.close();
View Full Code Here

TOP

Related Classes of edu.stanford.bmir.protege.web.shared.csv.CSVGrid$Builder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.