Class Urls

java.lang.Object
org.loboevolution.common.Urls

public class Urls extends Object

Urls class.

  • Field Details

    • PATTERN_RFC1123

      public static final DateFormat PATTERN_RFC1123
      The Constant PATTERN_RFC1123.
  • Constructor Details

    • Urls

      public Urls()
  • Method Details

    • createURI

      public static URI createURI(String baseUri, String relativeUrl) throws Exception

      createURI.

      Parameters:
      baseUri - a URL object.
      relativeUrl - a String object.
      Returns:
      a URI object.
      Throws:
      Exception - if any.
    • encodeIllegalCharacters

      public static String encodeIllegalCharacters(String url)
      Converts the given URL into a valid URL by encoding illegal characters. Right now it is implemented like in IE7: only spaces are replaced with "%20". (Firefox 3 also encodes other non-ASCII and some ASCII characters).
      Parameters:
      url - a String object.
      Returns:
      the encoded URL
    • getCharset

      public static String getCharset(URLConnection connection)

      getCharset.

      Parameters:
      connection - a URLConnection object.
      Returns:
      a String object.
    • isAbsolute

      public static boolean isAbsolute(String url)

      isAbsolute.

      Parameters:
      url - a String object.
      Returns:
      a boolean.
    • isLocalFile

      public static boolean isLocalFile(URL url)

      isLocalFile.

      Parameters:
      url - a URL object.
      Returns:
      a boolean.
    • getExpiration

      public static Long getExpiration(URLConnection connection, long baseTime)

      getExpiration.

      Parameters:
      connection - a URLConnection object.
      baseTime - a long.
      Returns:
      a Long object.
    • exists

      public static boolean exists(URL url)