Examples of UPnPIcon


Examples of org.osgi.service.upnp.UPnPIcon

  /* (non-Javadoc)
   * @see org.osgi.service.upnp.UPnPDevice#getIcons(java.lang.String)
   */
  public UPnPIcon[] getIcons(String locale) {
    UPnPIcon icon = new ClockIcon();
    return new UPnPIcon[]{icon} ;
  }
View Full Code Here

Examples of org.osgi.service.upnp.UPnPIcon

        String udn = request.getParameter("icon"); //$NON-NLS-1$

        if (udn != null)
        {
            UPnPIcon icon = getIcon(udn);
            if (icon == null)
            {
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
            }
            else
            {
                if (request.getDateHeader("If-Modified-Since") > 0) //$NON-NLS-1$
                {
                    // if it is already in cache - don't bother to go further
                    response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
                }
                else
                {
                    // enable caching
                    response.setDateHeader("Last-Modified", LAST_MODIFIED); //$NON-NLS-1$

                    InputStream in = icon.getInputStream();
                    if (null == in)
                    { // this is buggy implementations
                        response.setStatus(HttpServletResponse.SC_NOT_FOUND);
                        return;
                    }

                    String mime = icon.getMimeType();
                    if (mime != null)
                        response.setContentType(mime);
                    OutputStream out = response.getOutputStream();

                    int size = icon.getSize();
                    if (size > 0)
                        response.setContentLength(size);

                    // can't use buffer, because it's might block if reading byte[]
                    int read;
View Full Code Here

Examples of org.osgi.service.upnp.UPnPIcon

            {
                continue;
            }

            final UPnPDevice device = (UPnPDevice) bc.getService(ref);
            UPnPIcon icon = null;
            try
            { // Fix for FELIX-4012
                UPnPIcon[] _icons = device == null ? null : device.getIcons(null);
                icon = _icons != null && _icons.length > 0 ? _icons[0] : null;
            }
View Full Code Here

Examples of org.osgi.service.upnp.UPnPIcon

        String udn = request.getParameter("icon"); //$NON-NLS-1$

        if (udn != null)
        {
            UPnPIcon icon = (UPnPIcon) icons.get(udn);
            if (icon == null)
            {
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
            }
            else
            {
                if (request.getDateHeader("If-Modified-Since") > 0) //$NON-NLS-1$
                {
                    // if it is already in cache - don't bother to go further
                    response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
                }
                else
                {
                    // enable caching
                    response.setDateHeader("Last-Modified", LAST_MODIFIED); //$NON-NLS-1$

                    InputStream in = icon.getInputStream();
                    if (null == in)
                    { // this is buggy implementations
                        response.setStatus(HttpServletResponse.SC_NOT_FOUND);
                        return;
                    }

                    String mime = icon.getMimeType();
                    if (mime != null)
                        response.setContentType(mime);
                    OutputStream out = response.getOutputStream();

                    int size = icon.getSize();
                    if (size > 0)
                        response.setContentLength(size);

                    // can't use buffer, because it's might block if reading byte[]
                    int read;
View Full Code Here

Examples of org.osgi.service.upnp.UPnPIcon

  /* (non-Javadoc)
   * @see org.osgi.service.upnp.UPnPDevice#getIcons(java.lang.String)
   */
  public UPnPIcon[] getIcons(String locale) {
    UPnPIcon icon = new LightIcon();
    return new UPnPIcon[]{icon} ;
  }
View Full Code Here

Examples of org.osgi.service.upnp.UPnPIcon

  /* (non-Javadoc)
   * @see org.osgi.service.upnp.UPnPDevice#getIcons(java.lang.String)
   */
  public UPnPIcon[] getIcons(String locale) {
    UPnPIcon icon = new TvIcon();
    return new UPnPIcon[]{icon} ;
  }
View Full Code Here

Examples of org.osgi.service.upnp.UPnPIcon

    properties.put(UPnPDevice.UPC, dev.getUPC());

    IconList iconsList = dev.getIconList();
    if (iconsList.size() != 0) {
      for (int i = 0; i < iconsList.size(); i++) {
        UPnPIcon icon = new UPnPIconImpl(iconsList.getIcon(i),dev);
        icons.add(icon);
      }
    }
    /*
     * service of this device
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.