Package org.apache.stanbol.enhancer.servicesapi

Examples of org.apache.stanbol.enhancer.servicesapi.InvalidContentException


    }
    String text = "";
    try {
      text = ContentItemHelper.getText(contentPart.getValue());
    } catch (IOException e) {
      throw new InvalidContentException(this, ci, e);
    }
    if (text.trim().length() == 0) {
      log.info("No text contained in ContentPart {" + contentPart.getKey() + "} of ContentItem {" + ci.getUri() + "}");
      return;
    }
View Full Code Here


    }
    String text;
    try {
      text = ContentItemHelper.getText(contentPart.getValue());
    } catch (IOException e) {
      throw new InvalidContentException(this, ci, e);
    }
    if (text.trim().length() == 0) {
      log.info("No text contained in ContentPart {" + contentPart.getKey() + "} of ContentItem {" + ci.getUri() + "}");
      return;
    }
View Full Code Here

                    || (ContentItemHelper.getText(ci.getBlob()).trim().isEmpty())) {
                return CANNOT_ENHANCE;
            }
        } catch (IOException e) {
            log.error("Failed to get the text for " + "enhancement of content: " + ci.getUri(), e);
            throw new InvalidContentException(this, ci, e);
        }
        // default enhancement is synchronous enhancement
        return ENHANCE_SYNCHRONOUS;
    }
View Full Code Here

    }
    String text;
    try {
      text = ContentItemHelper.getText(contentPart.getValue());
    } catch (IOException e) {
      throw new InvalidContentException(this, ci, e);
    }
    if (text.trim().length() == 0) {
      log.info("No text contained in ContentPart {} of ContentItem {}",
          contentPart.getKey(),ci.getUri());
      return;
View Full Code Here

                return CANNOT_ENHANCE;
            }
        } catch (IOException e) {
            log.error("Failed to get the text for "
                    + "enhancement of content: " + ci.getUri(), e);
            throw new InvalidContentException(this, ci, e);
        }
        // no reason why we should require to be executed synchronously
        return ENHANCE_ASYNC;
    }
View Full Code Here

                    new UriRef("http://example.org/ontology/LengthEnhancement")));
            metadata.add(new TripleImpl(textAnnotation, RDFS.comment,
                    new PlainLiteralImpl("A text of " + content.length() + " charaters")));
        } catch (IOException ex) {
            log.error("Exception reading content item.", ex);
            throw new InvalidContentException("Exception reading content item.", ex);
        }
    }
View Full Code Here

        }
        String text;
        try {
            text = ContentItemHelper.getText(contentPart.getValue());
        } catch (IOException e) {
            throw new InvalidContentException(String.format("Unable to extract "
                +" text from ContentPart %s of ContentItem %s!",
                contentPart.getKey(),ci.getUri()),e);
        }
        if (text.trim().length() == 0) {
            // TODO: make the length of the data a field of the ContentItem
View Full Code Here

    }
    String text = "";
    try {
      text = ContentItemHelper.getText(contentPart.getValue());
    } catch (IOException e) {
      throw new InvalidContentException(this, ci, e);
    }
    if (text.trim().length() == 0) {
      log.info("No text contained in ContentPart {"+contentPart.getKey()+"} of ContentItem {"+ci.getUri()+"}");
      return;
    }
View Full Code Here

    }
    String text = "";
    try {
      text = ContentItemHelper.getText(contentPart.getValue());
    } catch (IOException e) {
      throw new InvalidContentException(this, ci, e);
    }
    if (text.trim().length() == 0) {
      log.info("No text contained in ContentPart {" + contentPart.getKey() + "} of ContentItem {" + ci.getUri() + "}");
      return;
    }
View Full Code Here

        }
        String text = "";
        try {
            text = ContentItemHelper.getText(contentPart.getValue());
        } catch (IOException e) {
            throw new InvalidContentException(this, ci, e);
        }
        //do not call trim() on long texts to check if the text is empty
        if (text.length() < 50  && text.trim().length() == 0) {
            log.info("No text contained in ContentPart {} of ContentItem {}",
                contentPart.getKey(),ci.getUri());
View Full Code Here

TOP

Related Classes of org.apache.stanbol.enhancer.servicesapi.InvalidContentException

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.