Package org.apache.wsil.util
Class Util
java.lang.Object
org.apache.wsil.util.Util
This class will ...
- Version:
- 1.0
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic String
createHttpsURL
(String url) Create an HTTPS URL.static URL
Creates a URL object.static void
This method prints a formatted message using System.out.prinln.static void
This method prints a formatted message using System.out.prinln.static ThreadGroup
findThreadGroup
(String sName) Local a thread group using its name.static String
Build a URL string from hostname, port and URN.static String
Get date/time stamp for current date/time.static String
getDateTimeStamp
(Date date) Get date/time stamp for current date/time.static InputStream
getInputStream
(String sResourceName) Get contents of a resource and return as a input stream.static InputStream
getInputStream
(URL urlFile) Get the input stream from a URL.static String
Get local host name.static void
This method prints a formatted message using System.out.prinln.static void
This method prints a formatted message using System.out.prinln.static String
replaceString
(String sText, String sFind, String sReplace) This method will replace all of the occurances of a string with a substitution string.static String[]
Convert a string into a string array.static String[]
toStringArray
(String s, String sDelim) Convert a string into a string array.static String
toXMLString
(Collection collection) Get XML string representation for WSIL element.
-
Field Details
-
sClassName
Class name. -
LINE_SEPARATOR
Line separator character.
-
-
Method Details
-
findThreadGroup
Local a thread group using its name.- Parameters:
sName
- thread group name- Returns:
- Returns thread group.
-
out
This method prints a formatted message using System.out.prinln.- Parameters:
className
- class name which originated messagemethodName
- method name which originated messagee
- exception
-
out
This method prints a formatted message using System.out.prinln.- Parameters:
className
- class name which originated messagemethodName
- method name which originated messagemsg
- message text
-
debug
This method prints a formatted message using System.out.prinln.- Parameters:
className
- class name which originated messagemethodName
- method name which originated messagee
- exception
-
debug
This method prints a formatted message using System.out.prinln.- Parameters:
className
- class name which originated messagemethodName
- method name which originated messagemsg
- message text
-
getDateTimeStamp
Get date/time stamp for current date/time.- Parameters:
sName
- thread group name
-
getDateTimeStamp
Get date/time stamp for current date/time.- Parameters:
sName
- thread group name
-
getInputStream
Get contents of a resource and return as a input stream.- Parameters:
sResourceName
- the name of the resource to get and return as an input stream- Throws:
IOException
-
getInputStream
Get the input stream from a URL.- Parameters:
url
- the URL to get the input stream from- Throws:
IOException
ConnectException
-
getLocalHostName
Get local host name. -
formatURL
Build a URL string from hostname, port and URN.- Parameters:
hostname
- the hostnameport
- the porturn
- the URN- Returns:
- Returns formatted URL string.
-
replaceString
This method will replace all of the occurances of a string with a substitution string.- Parameters:
sText
- String to udpate.sFind
- String to find.sReplace
- String to use for substitution.- Returns:
- Returns updated string.
-
toStringArray
Convert a string into a string array.- Parameters:
s
- string to convert to a string array
-
toStringArray
Convert a string into a string array.- Parameters:
s
- string to convert to a string array
-
createURL
public static URL createURL(String urlString) throws MalformedURLException, ClassNotFoundException, InstantiationException, IllegalAccessException Creates a URL object. If the URL uses the https protocol, then the correct URLStreamHandler is associated with the URL object.- Parameters:
urlString
- URL string to format into a URL object- Returns:
- Returns a URL object. A null value is returned if the input URL string is null.
- Throws:
MalformedURLException
ClassNotFoundException
InstantiationException
IllegalAccessException
-
createHttpsURL
Create an HTTPS URL. -
toXMLString
Get XML string representation for WSIL element.
-