Package org.xhtmlrenderer.resource

Examples of org.xhtmlrenderer.resource.CSSResource


   *
   * @param uri Location of the CSS source.
   * @return A CSSResource containing the parsed CSS.
   */
  public CSSResource getCSSResource(String uri) {
        return new CSSResource(resolveAndOpenStream(uri));
    }
View Full Code Here


        } catch (MalformedURLException e) {
            XRLog.exception("bad URL given: " + uri, e);
        } catch (IOException e) {
            XRLog.exception("IO problem for " + uri, e);
        }
        return new CSSResource(is);
    }
View Full Code Here

     *
     * @param uri Location of the CSS source.
     * @return A CSSResource containing the parsed CSS.
     */
    public CSSResource getCSSResource(String uri) {
        return new CSSResource(resolveAndOpenStream(uri));
    }
View Full Code Here

        // uri is in fact a complete URL
        String path = new URL(uri).getPath();
        Option<InputStream> option = Play.current().resourceAsStream(
            path);
        if (option.isDefined()) {
          return new CSSResource(option.get());
        } else {
          return super.getCSSResource(uri);
        }
      } catch (MalformedURLException e) {
        Logger.error("fetching css " + uri, e);
View Full Code Here

    /**
     * @return Returns null if uri could not be loaded
     */
    private Stylesheet parse(StylesheetInfo info) {
        CSSResource cr = _userAgentCallback.getCSSResource(info.getUri());
        // Whether by accident or design, InputStream will never be null
        // since the null resource stream is wrapped in a BufferedInputStream
        InputStream is = cr.getResourceInputSource().getByteStream();
        try {
            return parse(new InputStreamReader(is, "UTF-8"), info);
        } catch (UnsupportedEncodingException e) {
            // Shouldn't happen
            throw new RuntimeException(e.getMessage(), e);
View Full Code Here

   *
   * @param uri Location of the CSS source.
   * @return A CSSResource containing the parsed CSS.
   */
  public CSSResource getCSSResource(String uri) {
        return new CSSResource(resolveAndOpenStream(uri));
    }
View Full Code Here

     *
     * @param uri Location of the CSS source.
     * @return A CSSResource containing the parsed CSS.
     */
    public CSSResource getCSSResource(String uri) {
        return new CSSResource(resolveAndOpenStream(uri));
    }
View Full Code Here

    /**
     * @return Returns null if uri could not be loaded
     */
    private Stylesheet parse(StylesheetInfo info) {
        CSSResource cr = _userAgentCallback.getCSSResource(info.getUri());
        if (cr==null) return null
        // Whether by accident or design, InputStream will never be null
        // since the null resource stream is wrapped in a BufferedInputStream
        InputSource inputSource=cr.getResourceInputSource();
        if (inputSource==null) return null;
        InputStream is = inputSource.getByteStream();
        if (is==null) return null;
        try {
            return parse(new InputStreamReader(is, "UTF-8"), info);
View Full Code Here

        } catch (MalformedURLException e) {
            XRLog.exception("bad URL given: " + uri, e);
        } catch (IOException e) {
            XRLog.exception("IO problem for " + uri, e);
        }
        return new CSSResource(is);
    }
View Full Code Here

        }
        return is;
    }

    public CSSResource getCSSResource(String uri) {
        return new CSSResource(getInputStream(uri));
    }
View Full Code Here

TOP

Related Classes of org.xhtmlrenderer.resource.CSSResource

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.