Package org.apache.droids.api

Examples of org.apache.droids.api.Protocol


   *                the string that contains the protocol
   * @return ready to use protocol plugin or null if non have been found
   * @throws ProtocolNotFoundException
   */
  public Protocol getProtocol(URI uri) throws ProtocolNotFoundException {
    Protocol protocol = null;
    try {
      String protocolName = uri.getScheme();
      if (protocolName == null) {
        throw new ProtocolNotFoundException(uri);
      }
View Full Code Here


    final String userAgent = this.getClass().getCanonicalName();
    if (log.isDebugEnabled()) {
      log.debug("Starting " + userAgent);
    }
    URI uri = link.getURI();
    final Protocol protocol = droid.getProtocolFactory().getProtocol(uri);
    if (protocol == null) {
      if (log.isWarnEnabled()) {
        log.warn("Unsupported protocol scheme '" + uri.getScheme() + "'");
      }
      return;
    }
   
    if (protocol.isAllowed(uri)) {
      if (log.isInfoEnabled()) {
        log.info("Loading " + uri);
      }
      ManagedContentEntity entity = protocol.load(uri);
      try {
        String contentType = entity.getMimeType();
        if (log.isDebugEnabled()) {
          log.debug("Content type " + contentType);
        }
View Full Code Here

    final String userAgent = this.getClass().getCanonicalName();
    if (LOG.isDebugEnabled()) {
      LOG.debug("Starting " + userAgent);
    }
    URI uri = link.getURI();
    final Protocol protocol = droid.getProtocolFactory().getProtocol(uri);
    if (protocol == null) {
      if (LOG.isWarnEnabled()) {
        LOG.warn("Unsupported protocol scheme '" + uri.getScheme() + "'");
      }
      return;
    }
   
    if (protocol.isAllowed(uri)) {
      if (LOG.isInfoEnabled()) {
        LOG.info("Loading " + uri);
      }
      ManagedContentEntity entity = null;
      try {
        entity = protocol.load(uri);
      } catch(OutOfMemoryError e) {
        LOG.error("Out of memory processing: " + uri + " skipping", e);
        throw new DroidsException(e);
      }
      try {
View Full Code Here

TOP

Related Classes of org.apache.droids.api.Protocol

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.