Package java.net

Examples of java.net.ContentHandler


    // ContentHandler interface method.
    //

    public Object getContent(URLConnection urlc) throws IOException
    {
        ContentHandler svc = getContentHandlerService();
        if (svc == null)
        {
            return urlc.getInputStream();
        }
        return svc.getContent(urlc);
    }
View Full Code Here


        {
            return getBuiltIn();
        }
        try
        {
            ContentHandler service;
            if (framework instanceof Felix)
            {
                service = (ContentHandler) ((Felix) framework).getContentHandlerService(m_mimeType);
            }
            else
View Full Code Here

                return (ContentHandler) m_builtIn.get(m_mimeType);
            }
        }
        if (m_factory != null)
        {
            ContentHandler result = m_factory.createContentHandler(m_mimeType);
            if (result != null)
            {
                return addToCache(m_mimeType, result);
            }
        }
View Full Code Here

        // IMPLEMENTATION NOTE: Caching is not strictly necessary for
        // stream handlers since the Java runtime caches them. Caching is
        // performed for code consistency between stream and content
        // handlers and also because caching behavior may not be guaranteed
        // across different JRE implementations.
        ContentHandler handler = getFromContentCache(mimeType);

        if (handler != null)
        {
            return handler;
        }
View Full Code Here

    this.contentType = contentType;
    this.factory = factory;
  }

  public Object getContent(URLConnection uConn) throws IOException {
    ContentHandler handler = factory.findAuthorizedContentHandler(contentType);
    if (handler != null)
      return handler.getContent(uConn);

    return uConn.getInputStream();
  }
View Full Code Here

        }
      }
    }
    // if parent is present do parent lookup before returning a proxy
    if (parentFactory != null) {
      ContentHandler parentHandler = parentFactory.createContentHandler(contentType);
      if (parentHandler != null)
        return parentHandler;
    }
    //If we can't find the content handler in the service registry, return Proxy with DefaultContentHandler set.
    //We need to do this because if we return null, we won't get called again for this content type.
View Full Code Here

        }
      }
    }
    // if parent is present do parent lookup before returning a proxy
    if (parentFactory != null) {
      ContentHandler parentHandler = parentFactory.createContentHandler(contentType);
      if (parentHandler != null)
        return parentHandler;
    }
    //If we can't find the content handler in the service registry, return Proxy with DefaultContentHandler set.
    //We need to do this because if we return null, we won't get called again for this content type.
View Full Code Here

        }
      }
    }
    // if parent is present do parent lookup before returning a proxy
    if (parentFactory != null) {
      ContentHandler parentHandler = parentFactory.createContentHandler(contentType);
      if (parentHandler != null)
        return parentHandler;
    }
    //If we can't find the content handler in the service registry, return Proxy with DefaultContentHandler set.
    //We need to do this because if we return null, we won't get called again for this content type.
View Full Code Here

            {
                public void serviceChanged(ServiceEvent serviceEvent)
                {
                    ServiceReference reference = serviceEvent.getServiceReference();

                    ContentHandler handler = (ContentHandler) URLStreamHandlerServiceImpl.this.framework.getSystemBundleContext().getService(reference);
                    ContentHandlerHolder holder = new ContentHandlerHolder(handler, (Integer) reference.getProperty(Constants.SERVICE_RANKING));

                    String mimetype = (String) reference.getProperty(URLConstants.URL_CONTENT_MIMETYPE);
                    Set<ContentHandlerHolder> holders = getContentHandlerHolders(mimetype);
View Full Code Here

    {
        LOGGER.entering(CLASS_NAME, "lookupContentHandler", mimetype);

        Set<ContentHandlerHolder> handlerSet = getContentHandlerHolders(mimetype);

        ContentHandler handler = handlerSet.iterator().next().getHandler();

        LOGGER.exiting(CLASS_NAME, "lookupContentHandler", handler);

        return handler;
    }
View Full Code Here

TOP

Related Classes of java.net.ContentHandler

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.