Class URIContent

java.lang.Object
ro.sync.ecss.css.URIContent
All Implemented Interfaces:
StaticContent

@API(type=NOT_EXTENDABLE, src=PRIVATE) public class URIContent extends Object implements StaticContent
URI content
  • Field Details

    • messages

      protected static final ro.sync.i18n.MessageBundle messages
      The messages resource bundle.
  • Constructor Details

    • URIContent

      @Deprecated public URIContent(String base, String href) throws ro.sync.ecss.css.UnsecureContextException
      Deprecated.
      Left only for backward compatibility.
      Constructor.
      Parameters:
      base - Base system ID.
      href - Href.
      Throws:
      ro.sync.ecss.css.UnsecureContextException - Connecting the an URI can be dangerous. If the context is not safe we will reject the URI so a connection will not be opened.
    • URIContent

      public URIContent(String base, String href, String cssSystemID) throws ro.sync.ecss.css.UnsecureContextException
      Constructor
      Parameters:
      base - Base system ID.
      href - Href.
      cssSystemID - The location where this content was encountered. Can be null.
      Throws:
      ro.sync.ecss.css.UnsecureContextException - Connecting the an URI can be dangerous. If the context is not safe we will reject the URI so a connection will not be opened.
  • Method Details

    • checkIfSafe

      public static void checkIfSafe(String cssSystemID) throws ro.sync.ecss.css.UnsecureContextException
      Connecting the an URI can be dangerous. If the context is not safe we will reject the URI so a connection will not be opened.
       p:before {
         content: url('http://devel-new.sync.ro/?&file;')
       }
       
      Parameters:
      cssSystemID - Location in which this URI content was detected.
      Throws:
      ro.sync.ecss.css.UnsecureContextException - If the context is not safe we will reject the URI so a connection will not be opened.
    • getType

      public int getType()
      Description copied from interface: StaticContent
      Gets the content type.
      Specified by:
      getType in interface StaticContent
      Returns:
      The content type.
      See Also:
    • getHref

      public String getHref()
      Returns:
      The href.
    • getBase

      public String getBase()
      Returns:
      The Base URL
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      See Also:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
      See Also:
    • getCatalogExpandedURL

      public URL getCatalogExpandedURL() throws MalformedURLException
      Returns the image URL after resolving it with the catalog. This methods should be used as a fallback for the extension bundle resolving.
      Returns:
      The expanded URL.
      Throws:
      MalformedURLException - if cannot build URL.
    • getCatalogExpandedURL

      public static URL getCatalogExpandedURL(String href, String base) throws MalformedURLException
      Returns the image URL after resolving it with the catalog. This methods should be used as a fallback for the extension bundle resolving.
      Parameters:
      href - The href.
      base - The base.
      Returns:
      The expanded URL.
      Throws:
      MalformedURLException - if cannot build URL.