Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.owasp.dependencycheck.utils
Class UrlStringUtils

    java.lang.Object
      org.owasp.dependencycheck.utils.UrlStringUtils

    public final class UrlStringUtils

extends Object

Author:
  Jeremy Long (jeremy.long@owasp.org)

Method Summary
`static boolean` | `containsUrl(String text)` Tests if the text provided contains a URL.
`static List<String>` | `extractImportantUrlData(String text)` Takes a URL, in String format, and adds the important parts of the URL to a list of strings.
`static boolean` | `isUrl(String text)` Tests if the given text is url.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### containsUrl

    public static boolean containsUrl(String text)

  Tests if the text provided contains a URL. This is somewhat limited search in that it only looks for (ftp|http|https)://

  Parameters:
    `text` - the text to search
  Returns:
    true if the text contains a url, otherwise false

### isUrl

    public static boolean isUrl(String text)

  Tests if the given text is url.

  Parameters:
    `text` - the string to test
  Returns:
    returns true if the text is a url, otherwise false

### extractImportantUrlData

    public static List<String> extractImportantUrlData(String text)
                                                throws MalformedURLException

  Takes a URL, in String format, and adds the important parts of the URL to a list of strings.

  Example, given the following input:

  `"https://www.somedomain.com/path1/path2/file.php?id=439"`

  The function would return:

  `{"somedomain", "path1", "path2", "file"}`

  Parameters:
    `text` - a URL
  Returns:
    importantParts a list of the important parts of the URL
  Throws:
    `MalformedURLException` - thrown if the URL is malformed

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2012-2013 OWASP. All Rights Reserved.