Class ResourceUrlCreator


  • class ResourceUrlCreator
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static Logger LOG  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.lang.String emptyIfNull​(java.lang.String part)  
      (package private) static java.net.URL getUrl​(Resource resource, boolean usePack, boolean useVersion)
      Returns a url for the resource.
      (package private) static java.net.URL getVersionedUrl​(java.net.URL resourceUrl, VersionString requestVersion, VersionId currentVersion)
      Returns the URL for this resource, including the resource's version number in the query string
      (package private) static java.util.List<java.net.URL> prependHttps​(java.util.List<java.net.URL> urls)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOG

        private static final Logger LOG
    • Constructor Detail

      • ResourceUrlCreator

        ResourceUrlCreator()
    • Method Detail

      • prependHttps

        static java.util.List<java.net.URL> prependHttps​(java.util.List<java.net.URL> urls)
      • getUrl

        static java.net.URL getUrl​(Resource resource,
                                   boolean usePack,
                                   boolean useVersion)
        Returns a url for the resource.
        Parameters:
        resource - the resource
        usePack - whether the URL should point to the pack200 file
        useVersion - whether the URL should be modified to include the version
        Returns:
        a URL for the resource or null if an appropriate URL can not be found
      • getVersionedUrl

        static java.net.URL getVersionedUrl​(java.net.URL resourceUrl,
                                            VersionString requestVersion,
                                            VersionId currentVersion)
        Returns the URL for this resource, including the resource's version number in the query string
        Returns:
        url with version cared about
      • emptyIfNull

        private static java.lang.String emptyIfNull​(java.lang.String part)