java.lang.Object
net.foxgenesis.util.StringUtils
Utility class for Strings
- Author:
- Ashley
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stream<MatchResult>findURLWithGroups(String str) Find all URLs within a String and split its components into groups.static Stringstatic String[]toSplitString(InputStream input) static StringtoString(InputStream input)
-
Field Details
-
PATTERN_URL
Compiled regex checking for URL character sequences. This pattern is case insensitive.\b((http|https|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]) -
PATTERN_URL_WITH_GROUPING
Compiled regex checking for URL character sequences. This pattern is case insensitive and contains named groups forprotocol,domainandpath.\b(?<protocol>http|https|ftp|file)://(?<domain>[-a-zA-Z0-9+&@#%?=~_|!:,.;]*[-a-zA-Z0-9+&@#%=~_|])(?<path>\S*) -
CONTAINS_URL
NEED_JAVADOC
-
-
Constructor Details
-
StringUtils
public StringUtils()
-
-
Method Details
-
findURLWithGroups
Find all URLs within a String and split its components into groups.- Parameters:
str- - String to check- Returns:
- A
StreamofMatchResultscontaining URL groups:protocol(1),domain(2) andpath(3)
-
limit
-
toString
- Throws:
IOException
-
toSplitString
- Throws:
IOException
-