Examples of MarmottaImportException


Examples of org.apache.marmotta.platform.core.exception.io.MarmottaImportException

    //mimetype detection
    RDFFormat rdfFormat = Rio.getParserFormatForFileName(fileName);
    if (rdfFormat != null && importService.getAcceptTypes().contains(rdfFormat.getDefaultMIMEType())) {
      format = rdfFormat.getDefaultMIMEType();
    } else {
      throw new MarmottaImportException("Suitable RDF parser not found");
    }

      //encoding detection
    try {
      BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
View Full Code Here

Examples of org.apache.marmotta.platform.core.exception.io.MarmottaImportException

  private Importer getImporterInstance(String type) throws MarmottaImportException {
    if (StringUtils.contains(type, ';')) {
      type = type.split(";")[0];
    }
    if(!importerMap.containsKey(type)) {
      throw new MarmottaImportException("no importer defined for type " + type);
    }
    return importerMap.get(type);
  }
View Full Code Here

Examples of org.apache.marmotta.platform.core.exception.io.MarmottaImportException

  private Importer getImporterInstance(String type) throws MarmottaImportException {
    if (StringUtils.contains(type, ';')) {
      type = type.split(";")[0];
    }
    if(!importerMap.containsKey(type)) {
      throw new MarmottaImportException("no importer defined for type " + type);
    }
    return importerMap.get(type);
  }
View Full Code Here

Examples of org.apache.marmotta.platform.core.exception.io.MarmottaImportException

            } else {
                log.error("could not load ontology; InputStream was null");
            }
        } catch (Exception ex) {
            log.error("error while importing Sesame data:", ex);
            throw new MarmottaImportException(ex);
        } finally {
            taskManagerService.endTask(task);
        }
        return count;
View Full Code Here

Examples of org.apache.marmotta.platform.core.exception.io.MarmottaImportException

            } else {
                log.error("could not load ontology; InputStream was null");
            }
        } catch (Exception ex) {
            log.error("error while importing Sesame data:", ex);
            throw new MarmottaImportException(ex);
        } finally {
            taskManagerService.endTask(task);
        }
        return count;
    }
View Full Code Here

Examples of org.apache.marmotta.platform.core.exception.io.MarmottaImportException

            URI user = userService.getAdminUser();
            importService.importData(is, format, user, context);
            is.close();
            return true;
        } catch (IOException e) {
            throw new MarmottaImportException("Could not read input file " + file.toFile().getAbsolutePath(), e);
        }
    }
View Full Code Here

Examples of org.apache.marmotta.platform.core.exception.io.MarmottaImportException

                log.trace("Using format {} based on file-name {}", format, fileName);
            }
        }

        if (format == null || !importService.getAcceptTypes().contains(format)) {
            throw new MarmottaImportException("Suitable RDF parser not found");
        }

        // encoding detection
        // FIXME: is this required?
        try (BufferedInputStream bis = new BufferedInputStream(openStream(file))) {
View Full Code Here

Examples of org.apache.marmotta.platform.core.exception.io.MarmottaImportException

  public int importData(Reader reader, String format, Resource user, URI context) throws MarmottaImportException {
    return getImporterInstance(format).importData(reader,format,user,context);
  }

  private Importer getImporterInstance(String type) throws MarmottaImportException {
    if(!importerMap.containsKey(type)) throw new MarmottaImportException("no importer defined for type "+type);
    return importerMap.get(type);
  }
View Full Code Here

Examples of org.apache.marmotta.platform.core.exception.io.MarmottaImportException

            } else {
                log.error("could not load ontology; InputStream was null");
            }
        } catch (Exception ex) {
            log.error("error while importing Sesame data:", ex);
            throw new MarmottaImportException(ex);
        } finally {
            taskManagerService.endTask(task);
        }
        return count;
View Full Code Here

Examples of org.apache.marmotta.platform.core.exception.io.MarmottaImportException

            } else {
                log.error("could not load ontology; InputStream was null");
            }
        } catch (Exception ex) {
            log.error("error while importing Sesame data:", ex);
            throw new MarmottaImportException(ex);
        } finally {
            taskManagerService.endTask(task);
        }
        return count;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.