public class Misc extends Object
Modifier and Type | Field and Description |
---|---|
static String |
LINE_SEPARATOR |
static String |
MESSAGE_SIZE_WARN_BY_DEFAULT_KEY |
Constructor and Description |
---|
Misc() |
Modifier and Type | Method and Description |
---|---|
static void |
addItemsToList(Collection<String> collection,
String list,
String collectionDescription,
boolean lowercase)
Adds items on a string, added by comma separator (ex: "1,2,3"), into a list.
|
static <T> void |
addToSortedListNonUnique(List<T> list,
T item) |
static <T> void |
addToSortedListUnique(List<T> list,
T item) |
static InputSource |
asInputSource(URL url) |
static String |
byteArrayToString(byte[] input,
String endOfLineString,
boolean xmlEncode)
Converts a byte array into a string, and adds a specified string to the end of the converted string.
|
static String |
cleanseMessage(String inputString,
String regexForHiding,
IMessageBrowser.HideMethod hideMethod)
Edits the input string according to the regex and the hide method specified.
|
static void |
copyContext(String keys,
Map<String,Object> from,
Map<String,Object> to,
INamedObject requester) |
static String |
getAge(long value) |
static String |
getApplicationDeploymentDescriptor() |
static String |
getApplicationDeploymentDescriptorPath() |
static String |
getBuildOutputDirectory() |
static String |
getConfigurationResources() |
static String |
getConfigurationServer() |
static String |
getConnectionPoolProperties(String confResString,
String providerType,
String jndiName) |
static String |
getDeployedApplicationBindings() |
static String |
getDurationInMs(long value) |
static String |
getFileSystemFreeSpace() |
static String |
getFileSystemTotalSpace() |
static String |
getHostname() |
static int |
getMaximumTransactionTimeout() |
static Integer |
getMaximumTransactionTimeout(String configServerXml) |
static long |
getMessageSizeWarnByDefault() |
static String |
getProjectBaseDir() |
static Integer |
getTotalTransactionLifetimeTimeout() |
static Integer |
getTotalTransactionLifetimeTimeout(String configServerXml) |
static String |
insertAuthorityInUrlString(String url,
String authAlias,
String username,
String password) |
static String |
jsonPretty(String json) |
static String |
listToString(List<String> list)
Converts the list to a string.
|
static long |
parseAge(String value,
long defaultValue) |
static String |
toFileSize(long value) |
static String |
toFileSize(long value,
boolean format) |
static String |
toFileSize(long value,
boolean format,
boolean floor)
Converts the input value in bytes to the highest degree of file size, and formats and floors the value, if set to true.
|
static long |
toFileSize(String value,
long defaultValue)
Converts the file size to bytes.
|
static String |
urlDecode(String input) |
public static final String MESSAGE_SIZE_WARN_BY_DEFAULT_KEY
public static final String LINE_SEPARATOR
public static String insertAuthorityInUrlString(String url, String authAlias, String username, String password)
public static String byteArrayToString(byte[] input, String endOfLineString, boolean xmlEncode) throws IOException
IOException
StreamUtil.streamToString(InputStream, String, boolean)
public static String getHostname()
public static void copyContext(String keys, Map<String,Object> from, Map<String,Object> to, INamedObject requester)
public static String getApplicationDeploymentDescriptorPath() throws IOException
IOException
public static String getDeployedApplicationBindings() throws IOException
IOException
public static String getApplicationDeploymentDescriptor() throws IOException
IOException
public static String getConfigurationResources()
public static String getConfigurationServer() throws IOException
IOException
public static String getConnectionPoolProperties(String confResString, String providerType, String jndiName)
public static long toFileSize(String value, long defaultValue)
Misc.toFileSize("14GB", 20); // gives out 15032385536
public static String toFileSize(long value)
toFileSize(long, boolean)
public static String toFileSize(long value, boolean format)
toFileSize(long, boolean, boolean)
public static String toFileSize(long value, boolean format, boolean floor)
String mb = Misc.toFileSize(15000000, true); // gives out "14 MB" String kb = Misc.toFileSize(150000, false, true); // gives out "146KB"
public static long getMessageSizeWarnByDefault()
public static String listToString(List<String> list)
Listlist = new ArrayList<>(); list.add("We Are"); list.add(" Frank"); String res = Misc.listToString(list); // res gives out "We Are Frank"
public static void addItemsToList(Collection<String> collection, String list, String collectionDescription, boolean lowercase)
collectionDescription
- description of the listpublic static String getFileSystemTotalSpace()
public static String getFileSystemFreeSpace()
public static Integer getTotalTransactionLifetimeTimeout()
public static Integer getTotalTransactionLifetimeTimeout(String configServerXml)
public static int getMaximumTransactionTimeout()
public static Integer getMaximumTransactionTimeout(String configServerXml)
public static String getAge(long value)
public static String getDurationInMs(long value)
public static long parseAge(String value, long defaultValue)
public static String cleanseMessage(String inputString, String regexForHiding, IMessageBrowser.HideMethod hideMethod)
public static String getBuildOutputDirectory()
public static String getProjectBaseDir()
public static <T> void addToSortedListUnique(List<T> list, T item)
public static <T> void addToSortedListNonUnique(List<T> list, T item)
public static InputSource asInputSource(URL url) throws IOException
IOException
Copyright © 2023 Frank!Framework. All rights reserved.