Package org.kitesdk.morphline.api

Examples of org.kitesdk.morphline.api.MorphlineRuntimeException


    InputStream stream = getAttachmentInputStream(record);
    try {
      return doProcess(record, stream);
    } catch (IOException e) {
      throw new MorphlineRuntimeException(e);
    } finally {
      Closeables.closeQuietly(stream);
    }
  }
View Full Code Here


      return charset;
    }
    List charsets = record.get(Fields.ATTACHMENT_CHARSET);
    if (charsets.size() == 0) {
      // TODO try autodetection (AutoDetectReader)
      throw new MorphlineRuntimeException("Missing charset for record: " + record);
    }
    String charsetName = (String) charsets.get(0);       
    return Charset.forName(charsetName);
  }
View Full Code Here

        }

        try {
          parser.parse(inputStream, parsingHandler, metadata, parseContext);
        } catch (IOException e) {
          throw new MorphlineRuntimeException("Cannot parse", e);
        } catch (SAXException e) {
          throw new MorphlineRuntimeException("Cannot parse", e);
        } catch (TikaException e) {
          throw new MorphlineRuntimeException("Cannot parse", e);
        }
      } finally {
        if (inputStream != null) {
          Closeables.closeQuietly(inputStream);
        }
View Full Code Here

      CompressorInputStream cis;
      try {
        CompressorStreamFactory factory = new CompressorStreamFactory();
        cis = factory.createCompressorInputStream(stream);
      } catch (CompressorException e) {
        throw new MorphlineRuntimeException("Unable to uncompress document stream", e);
      }

      try {
        return extractor.parseEmbedded(cis, record, name, getChild());
      } finally {
View Full Code Here

          if (!extract(datum, template)) {
            return false;
          }
        }
      } catch (IOException e) {
        throw new MorphlineRuntimeException(e);
      } finally {
        Closeables.closeQuietly(reader);
      }
    }
View Full Code Here

          }
        }
      }
      LOG.warn("tryRules command found no successful rule");
      if (throwExceptionIfAllRulesFailed) {
        throw new MorphlineRuntimeException("tryRules command found no successful rule for record: " + record);
      }
      return false;
    }
View Full Code Here

    private String getMediaType(InputStream in, Metadata metadata, boolean excludeParameters) {
      MediaType mediaType;
      try {
        mediaType = getDetector().detect(in, metadata);
      } catch (IOException e) {
        throw new MorphlineRuntimeException(e);
      }
      String mediaTypeStr = mediaType.toString();
      if (excludeParameters) {
        int i = mediaTypeStr.indexOf(';');
        if (i >= 0) {
View Full Code Here

      } else if (isIgnoringRecoverableExceptions()) {
        LOG.warn("Ignoring recoverable exception in production mode for record: " + record, t);
        return;
      }
    }
    throw new MorphlineRuntimeException(t);
  }
View Full Code Here

       
        JsonNode json;
        try {
          json = databaseReader.get(addr);
        } catch (IOException e) {
          throw new MorphlineRuntimeException("Cannot perform GeoIP lookup for IP: " + addr, e);
        }
       
        ObjectNode location = (ObjectNode) json.get("location");
        if (location != null) {
          JsonNode jlatitude = location.get("latitude");
View Full Code Here

          server.setHandler(servletContextHandler);
         
          try {
            server.start();
          } catch (Exception e) {
            throw new MorphlineRuntimeException(e);
          }
         
          SERVERS.put(port, server);
        }
      }
View Full Code Here

TOP

Related Classes of org.kitesdk.morphline.api.MorphlineRuntimeException

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.