public interface AQUtil
A singleton instance of this class is mapped to a global name aqua.util.
Modifier and Type | Method and Description |
---|---|
java.lang.String |
formatByteSize(double bytes,
java.lang.String format,
int decimalPos)
Formats size of files into something more readable.
|
java.lang.String |
formatTimeInterval(long interval)
Formats time interval into human-readable form.
|
byte[] |
hexDecode(java.lang.String data)
Converts an array of characters representing hexidecimal values into an
array of bytes of those same values.
|
java.lang.String |
hexEncode(byte[] data)
Converts an array of bytes into an array of characters representing the hexidecimal values of each byte in order.
|
java.lang.String |
htmlDecode(java.lang.String text)
Unescapes a string containing HTML entity escapes to a string containing the actual Unicode
characters corresponding to the escapes.
|
java.lang.String |
htmlEncode(java.lang.String text)
Escapes the characters in a String using HTML entities.
|
boolean |
isBlank(java.lang.Object text)
Returns true if argument text is empty or contains only whitespace symbols.
|
java.lang.Object |
newJavaArray(java.lang.String type,
int length)
Creates a new java array with the specified component type and length.
|
void |
sleep(int ms)
Causes script to sleep for a specified number of milliseconds.
|
java.lang.String |
sqlEncode(java.lang.String string)
Escapes single quote characters in a string to make it safe for inclusion into a SQL query.
|
java.lang.String |
urlEncode(java.lang.String string)
Translates a string into
x-www-form-urlencoded
format. |
void sleep(int ms) throws java.lang.Exception
ms
- Delay in milliseconds.java.lang.Exception
- On errorboolean isBlank(java.lang.Object text)
text
- A text string or AQOpaqueObject
.java.lang.String formatTimeInterval(long interval)
interval
- Time interval in milliseconds.java.lang.String formatByteSize(double bytes, java.lang.String format, int decimalPos) throws java.lang.Exception
bytes
- The value to be formatted.format
- Valid string values are "B", "KB", "MB", "GB", "TB"decimalPos
- Sets the maximum number of digits allowed in the fraction portion of a number.java.lang.Exception
- on errorjava.lang.String urlEncode(java.lang.String string)
x-www-form-urlencoded
format. This method uses UTF-8 encoding to obtain the bytes for unsafe characters.string
- A string to be encoded.java.lang.String sqlEncode(java.lang.String string)
string
- A string to be encoded.java.lang.String htmlEncode(java.lang.String text)
text
- Text string.java.lang.String htmlDecode(java.lang.String text)
text
- Encoded text string.java.lang.Object newJavaArray(java.lang.String type, int length) throws java.lang.Exception
aqua.util.newJavaArray('java.lang.String', 100);
aqua.util.newJavaArray('byte', 0);
type
- Fully qualified name of a Class
representing the component type of the new array.length
- The length of the new array.java.lang.Exception
- On errorjava.lang.String hexEncode(byte[] data)
data
- a byte[] to convert to Hex characters.byte[] hexDecode(java.lang.String data) throws java.lang.Exception
data
- An array of characters containing hexidecimal digitsjava.lang.Exception
- On Error
Copyright © 2017 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.