public class Utils
extends java.lang.Object
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
generateURL(java.lang.String protocol,
java.lang.String host,
java.lang.String port,
java.lang.String endpoint)
Generates a url given the http protocol, the host the port and the end point
|
static void |
textFileToStringBuffer(java.lang.Class cl,
java.lang.String fileName,
java.lang.StringBuffer sb,
java.lang.String sep)
Reads a text file under resource and appends it in a String Buffer
Example textFileToStringBuffer(FileUtils.class, "hello.txt", sb, "\n")
It will read the file "hello.txt" located where FileUtils.class is located
|
public static void textFileToStringBuffer(java.lang.Class cl, java.lang.String fileName, java.lang.StringBuffer sb, java.lang.String sep) throws java.io.IOException
cl
- The ClassfileName
- The filenamesb
- The StringBuffersep
- The line sepparatorjava.io.IOException
- In case I/O errorpublic static java.lang.String generateURL(java.lang.String protocol, java.lang.String host, java.lang.String port, java.lang.String endpoint)
protocol
- The protocol, typically http | httpshost
- The hostport
- The portendpoint
- The end point