public class Util extends Object
Modifier and Type | Field and Description |
---|---|
static LocalStringManagerImpl |
localStrings |
Modifier and Type | Method and Description |
---|---|
static RestActionReporter |
applyChanges(Map<String,String> data,
String basePath,
Subject subject) |
static RestActionReporter |
applyChanges(Map<String,String> data,
javax.ws.rs.core.UriInfo uriInfo,
Subject subject)
Apply changes passed in
data using CLI "set". |
static File |
createTempDirectory() |
static String |
decode(String string)
Decodes an encoded URL using UTF-8
|
static void |
deleteDirectory(File dir) |
static String |
eleminateHypen(String string)
Removes any hypens ( - ) from the given string.
|
static String |
getBeanName(String elementName) |
static Map<String,String> |
getCurrentValues(String basePath,
org.glassfish.hk2.api.ServiceLocator habitat,
Subject subject) |
static Map<String,String> |
getCurrentValues(String basePath,
Subject subject) |
static Class<?> |
getFirstGenericType(Type genericType)
This method takes a Type argument that represents a generic class (e.g.,
List<String>) and returns the
|
static int |
getFormattingIndentLevel()
Get the current configured indenting value for the REST layer
|
static String |
getGrandparentName(String url) |
static String |
getGrandparentName(javax.ws.rs.core.UriInfo uriInfo) |
protected static String |
getHtml(String message,
javax.ws.rs.core.UriInfo uriInfo,
boolean delete)
Returns the html for the given message.
|
static javax.ws.rs.client.Client |
getJerseyClient() |
static String |
getKeyAttributeName(ConfigModel model) |
static String |
getMethodParameterList(CommandModel cm,
boolean withType,
boolean includeOptional) |
static String |
getName(String typeName)
Returns just the name of the given fully qualified name.
|
static String |
getName(String typeName,
char delimiter)
Returns just the name of the given fully qualified name.
|
static String |
getParentName(String url)
returns just the parent name of the resource from the resource url.
|
static String |
getParentName(javax.ws.rs.core.UriInfo uriInfo)
Returns name of the resource parent from UriInfo.
|
static String |
getResourceName(javax.ws.rs.core.UriInfo uriInfo)
Returns name of the resource from UriInfo.
|
static boolean |
isGenericType(Type type) |
static void |
logTimingMessage(String msg) |
static String |
lowerCaseFirstLetter(String string)
Converts the first letter of the given string to lower case.
|
static String |
methodNameFromBeanName(String elementName,
String prefix)
Constructs a method name from element's bean
name for a given prefix.(schema2beans convention)
|
static String |
methodNameFromDtdName(String elementName,
String prefix)
Constructs a method name from element's dtd name
name for a given prefix.(schema2beans convention)
|
static ParameterMap |
parameterMap()
Convenience wrapper around ParameterMap constructor to make it easier to use its fluent API
|
static File |
saveFile(String fileName,
String mimeType,
InputStream fileStream) |
static String |
upperCaseFirstLetter(String string)
Converts the first letter of the given string to Uppercase.
|
static boolean |
useLegacyResponseFormat(javax.ws.rs.core.HttpHeaders requestHeaders) |
public static final LocalStringManagerImpl localStrings
public static void logTimingMessage(String msg)
public static String getResourceName(javax.ws.rs.core.UriInfo uriInfo)
public static String getParentName(javax.ws.rs.core.UriInfo uriInfo)
public static String getGrandparentName(javax.ws.rs.core.UriInfo uriInfo)
public static String getName(String typeName)
public static String getName(String typeName, char delimiter)
public static String getParentName(String url)
public static String eleminateHypen(String string)
string
- the input stringString
resulted after removing the hypenspublic static String decode(String string)
string
- string to decodepublic static String upperCaseFirstLetter(String string)
string
- the input stringpublic static String lowerCaseFirstLetter(String string)
string
- the input stringprotected static String getHtml(String message, javax.ws.rs.core.UriInfo uriInfo, boolean delete)
uriInfo
- the uriInfo context of the requestpublic static String methodNameFromDtdName(String elementName, String prefix)
elementName
- the given element nameprefix
- the given prefixpublic static String methodNameFromBeanName(String elementName, String prefix)
elementName
- the given element nameprefix
- the given prefixpublic static javax.ws.rs.client.Client getJerseyClient()
public static RestActionReporter applyChanges(Map<String,String> data, javax.ws.rs.core.UriInfo uriInfo, Subject subject)
data
using CLI "set".data
- The set of changes to be appliedpublic static RestActionReporter applyChanges(Map<String,String> data, String basePath, Subject subject)
public static Map<String,String> getCurrentValues(String basePath, Subject subject)
public static Map<String,String> getCurrentValues(String basePath, org.glassfish.hk2.api.ServiceLocator habitat, Subject subject)
public static String getKeyAttributeName(ConfigModel model)
model
- public static File createTempDirectory()
public static void deleteDirectory(File dir)
public static String getMethodParameterList(CommandModel cm, boolean withType, boolean includeOptional)
public static File saveFile(String fileName, String mimeType, InputStream fileStream)
public static boolean isGenericType(Type type)
public static Class<?> getFirstGenericType(Type genericType)
List<String>) and returns the
Class
for the first generic type. If the Class
is not a generic type,
null
is returned. The primary intended usage for this is in the MessageBodyReader
s to
help return a more accurate result from isReadable
, though it may also be helpful in other, more
general situations.
genericType
- public static int getFormattingIndentLevel()
public static boolean useLegacyResponseFormat(javax.ws.rs.core.HttpHeaders requestHeaders)
public static ParameterMap parameterMap()
Copyright © 2019. All rights reserved.