public final class GeneralUtil extends Object
Constructor and Description |
---|
GeneralUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
alwaysMaskEmail(String emailAddress)
Masks an email address by replacing '@' with 'at' and '.' with 'dot'.
|
static String |
appendAmpersandOrQuestionMark(String str)
Appends an ampersand if the given string already contains a question mark, or a question mark otherwise.
|
static String |
appendAmpsandOrQuestionMark(String str)
Deprecated.
since 5.7. Call
appendAmpersandOrQuestionMark(String) instead. |
static int |
arraySize(int[] array)
convenience method to allow us to determine the size of an int array a velocity file
|
static String |
base64Decode(String s) |
static String |
base64Encode(String s) |
static String |
cleanQuietly(String stringToClean)
Sanitizes the input by removing unsafe elements or attributes.
|
static String |
completeUrlEncode(String url)
Deprecated.
since 6.10.0 Use
HtmlUtil.completeUrlEncode(String) instead. |
static String |
constrainLength(String s,
int length)
Truncate a string after n characters
|
static Map<String,String> |
convertBeanToMap(Object bean) |
static Date |
convertMailFormatDate(String date) |
static Boolean |
convertToBoolean(Object obj) |
static boolean |
convertToBoolean(Object bool,
boolean defaultValue) |
static Character |
convertToCharacter(Object obj) |
static Integer |
convertToInteger(Object obj) |
static String |
convertToString(Object obj) |
static void |
copyDate(Calendar original,
Calendar copy)
Takes two calendar objects and sets the Date of the second to the Date of the first.
|
static File |
createTempDirectoryInConfluenceTemp(String prefix) |
static File |
createTempFile(String directory) |
static String |
customGetPageUrl(AbstractPage page)
Need a special case of generalutils getpageurl that appends ? or ampersand smartly
this is used to prefix url parameters that are appended after this path like:
showcomments=true#addcomment
|
static String |
displayShortUrl(String url) |
static String |
displayShortUrl(String url,
int length) |
static String |
doubleUrlEncode(String url)
Deprecated.
since 6.10.0, No replacement
|
static void |
elapse(String tag)
Add elapsed time to HttpRequestStats
|
static String |
escapeCDATA(String s) |
static List<String> |
escapeCommas(List<String> toEscape)
Escape commas on each entry in the given list of strings.
|
static String |
escapeCommas(String toEscape)
Escapes commas and backslashes with leading backslashes.
|
static String |
escapeForHtmlAttribute(String s)
Escapes " and \ with a leading \ so that strings can't break out of double-quoted HTML attributes.
|
static String |
escapeForJavascript(String s)
Escapes ', " and \ with a leading \.
|
static String[] |
escapeXml(Object[] args)
Produces an array of XML escaped
String s from a list of Objects. |
static String |
escapeXml(String stringToEscape) |
static String |
escapeXMLCharacters(String input)
Take a String which may contain <, > or & and return an XML string containing entities.
|
static <T> List<T> |
filterNulls(Collection<T> in)
Return a List with no null entries
|
static String |
findAndMaskEmail(String text,
com.atlassian.user.User currentUser) |
static void |
flushResponse()
Flushes response writer.
|
static String |
format(Number number)
Deprecated.
since 5.2. No replacement
|
static String |
format(Object obj)
Deprecated.
since 5.2. Use
DateFormatter or Strings.nullToEmpty(String) instead |
static String |
format(String str)
Deprecated.
since 5.2. Use
Strings.nullToEmpty(String) instead |
static String |
formatDateFull(Date date)
Deprecated.
since 5.2. Use a
DateFormatter instead |
static String |
formatLongTime(long time) |
static String |
getAttachmentUrl(Attachment attachment)
Get the permalink URL to preview the given attachment in the previewer.
|
static Date |
getBuildDate() |
static String |
getBuildDateString() |
static String |
getBuildNumber() |
static String |
getCharacterEncoding() |
static String |
getCommentUrl(Attachment attachment,
Comment comment)
Get the permalink URL to preview the given comment (annotation) in the previewer.
|
static String |
getCompactDuration(long time)
Returns the duration in a compact HH:mm:ss format.
|
static File |
getConfluenceTempDirectory()
Deprecated.
since 5.5. Use
getLocalTempDirectory() instead. |
static String |
getConfluenceTempDirectoryPath()
Deprecated.
since 5.5. Use
getLocalTempDirectory() instead. |
static String |
getCookieValue(javax.servlet.http.HttpServletRequest request,
String key) |
static String |
getCookieValue(String key) |
static ResourceBundle |
getDefaultResourceBundle() |
static String |
getEditPageUrl(AbstractPage page)
Get a resume draft URL that includes the shareDraftid
|
static String |
getFormatDateSimple(Date date) |
static Settings |
getGlobalSettings() |
static I18NBean |
getI18n() |
static String |
getIdBasedPageUrl(AbstractPage page)
Get page URL that is id based (i.e.
|
static com.atlassian.core.util.ImageInfo |
getImageInfo(File pathToImage) |
static File |
getLocalTempDirectory()
Checks if local temp directory exists before returning the path.
|
static String |
getNiceDuration(int minutes,
int seconds) |
static String |
getOriginalUrl(javax.servlet.http.HttpServletRequest request) |
static String |
getPageUrl(AbstractPage page) |
static String |
getPageUrl(VersionHistorySummary summary) |
static Comment |
getParentComment(Comment comment)
Returns the top-level comment that the comment is attached to
|
static AbstractPage |
getParentPageOrBlog(Contained content)
returns the page or blog that the content is attached to, or null if it is not attached to a page or blog.
|
static long |
getPercentage(long numerator,
long denom)
converts a fraction into a percentage
|
static long |
getPercentage(String numeratorAsString,
String denomAsString) |
static <T> List<T> |
getRandomSubSet(List<T> list,
int sizeOfSubset,
Random random)
Returns a randomised subset of the list provided.
|
static String |
getRelativeTime(Date date)
Deprecated.
since 2.7 use
FriendlyDateFormatter |
static String |
getRequestCorrelationId()
Returns request correlation id
|
static Duration |
getServerRenderTime(javax.servlet.http.HttpServletRequest servletRequest)
Calculates the duration of the request
|
static File |
getSharedTempDirectory()
Checks if shared temp directory exists before returning the path.
|
static String |
getStackTrace(Throwable t) |
static Long |
getSystemStartupTime() |
static Unzipper |
getUnzipper(File zipFile,
File dirToExtractTo) |
static Unzipper |
getUnzipper(URL zipUrl,
File dirToExtractTo) |
static String |
getUploadFileTooLargeMessage(String errorMessage)
if this error message is of the type: "java.io.IOException: Content Length Error"
convert it to something nicer
|
static UserAccessor |
getUserAccessor() |
static String |
getVersionNumber() |
static String |
hackSingleQuotes(String s)
hack to make strings that contain singles compatible with javascript (which also uses single quotes denote strings)
|
static boolean |
hasTooManyUsers()
Deprecated.
since 5.10 Use
UserAccessor.isLicensedToAddMoreUsers() |
static String |
highlight(String content,
String searchwords) |
static String |
htmlEncode(String text)
Deprecated.
since 6.10.0 Use
HtmlUtil.htmlEncode(String) instead) |
static String |
htmlEncodeAndReplaceSpaces(String text)
Deprecated.
since 6.10.0 Use
HtmlUtil.htmlEncodeAndReplaceSpaces(String) instead) |
static String |
htmlEscapeQuotes(String input)
Take a string and escape the quotes in it with \" and HTML escape them afterwards.
|
static boolean |
isAllAscii(String s) |
static boolean |
isAllLettersOrNumbers(String s) |
static boolean |
isDateWithin24Hours(Date date)
Determines if given date is within 24 hours
|
static boolean |
isDefaultUserProfilePicture(String username)
Deprecated.
since 2.7. Use
UserAccessor.getUserProfilePicture(com.atlassian.user.User) . |
static boolean |
isInLastDays(Date date,
int maxDays) |
static boolean |
isLicenseExpired() |
static boolean |
isOutgoingMailConfigured()
Deprecated.
since 5.0. Use
MailServerManager.isDefaultSMTPMailServerDefined() instead. |
static boolean |
isSafeTitleForFilesystem(String title)
Ensure the title is safe to be written to the file system.
|
static boolean |
isSafeTitleForUrl(String title)
Is "title" something we can safely put in a /foo/bar/title URL? Or should we reference this thing by ID
just to be safe?
|
static boolean |
isSetupComplete() |
static boolean |
isSuperUser(com.atlassian.user.User user)
Deprecated.
since 3.5 calls to the PermissionManager will ensure super-user checks are performed
|
static void |
loadDefaultProperties()
Deprecated.
since 3.0 because it doesn't do anything
|
static String |
lookupDomainName(javax.servlet.http.HttpServletRequest request)
Get the default domain name.
|
static String |
makeFlatSummary(String content)
Create a summary of this content fragment.
|
static String |
makeFlatSummary(String content,
String query)
Create a summary of this content fragment given a query
|
static com.atlassian.bonnie.search.summary.Summary |
makeSummary(String content)
Create a proper summary of this content fragment.
|
static com.atlassian.bonnie.search.summary.Summary |
makeSummary(String content,
String query)
Create a proper summary of this content fragment given a query
|
static String |
maskEmail(String emailAddress)
If configured, masks an email address to defeat the most simplistic spam bots.
|
static String |
maskEmail(String emailAddress,
Settings globalSettings,
I18NBean i18NBean) |
static ConfluenceActionSupport |
newWiredConfluenceActionSupport() |
static String |
personalSpaceUrl(String contextPath,
String username)
Deprecated.
since 5.0
You should instead retrieve the space using
SpaceManager
and call getUrlPath on the Space object. Also note that if a user has been renamed (which is possible
from Confluence 5.3 onwards) then this method is likely to return the wrong key. |
static String |
plain2html(String text) |
static String |
populateSimpleMessage(String template,
List<String> values)
Populate the template String supplied using the given values.
|
static <K,V> Map<K,V> |
prefixAllMapKeys(String prefix,
Map<K,V> map)
Convert the supplied Map so that all of the keys in the Map are prefixed by the supplied String
followed by a full stop.
|
static void |
profilePop(String s) |
static void |
profilePush(String s) |
static String |
rdfEncode(String s)
A fairly evil hack to work around CONF-10364.
|
static String |
refineOsDestination(String osDestination)
Escape XML and replace all space with %20
|
static String |
removeEmailsFromString(String text)
Remove all emails from text
|
static String |
replaceConfluenceConstants(String in,
File home,
File localHome)
Replaces
ConfluenceBootstrapConstants.CONFLUENCE_HOME_CONSTANT
and ConfluenceBootstrapConstants.CONFLUENCE_LOCAL_HOME_CONSTANT
in the given text with the correct paths. |
static String |
replaceConfluenceHomeConstant(String in,
String confHome)
Deprecated.
since 5.5. Use
replaceConfluenceConstants(String, java.io.File, java.io.File)
instead. |
static String |
replaceInvalidXmlCharacters(String text)
Take a String which may contain characters outside of the XML character range (http://www.w3.org/TR/REC-xml/#charsets)
and return a String with those characters converted to Unicode "Replacement Character"s (0xFFFD).
|
static <T> List<T> |
safeSubList(List<T> list,
int max) |
static javax.servlet.http.Cookie |
setCookie(String key,
String value)
Sets a cookie.
|
static void |
setSystemStartupTime(Long systemStartupTime) |
static void |
setUserAccessor(UserAccessor userAcc) |
static String |
shortenString(String str,
int max)
Returns a substring of the specified string if it is longer than max.
|
static boolean |
shouldUrlDecode(String str)
Deprecated.
since 6.10.0 Use
HtmlUtil.shouldUrlDecode(String) instead. |
static Collection<String> |
specialLowerCaseCollection(Collection<String> collection)
Takes a collection of Strings and lowercases the entries.
|
static String |
specialToLowerCase(String str)
the database lower() function in PostgreSQL only works for ASCII strings.
|
static String[] |
splitCommaDelimitedString(String escapedNames)
Method will turn a String of comma separated entities into a String Array.
|
static boolean |
stringSet(String str)
Deprecated.
since 5.10 Use
StringUtils.isNotEmpty(CharSequence) |
long |
subtract(long a,
long b)
Deprecated.
since 5.0. Just use a minus sign.
|
long |
subtract(String firstOperandAsString,
String secondOperandAsString)
Deprecated.
since 5.0. Just say no.
|
static String |
summarise(String content) |
static Date |
toEndOfMonth(Calendar postDate,
boolean isSqlServer)
Takes a Calendar object and returns the very end (last day, hour, minute, second and millisecond) of the month that the Calendar is in.
|
static String |
trimDownStringToWord(String s) |
static String |
unescapeCDATA(String s) |
static String |
unescapeEntities(String str) |
static void |
unzipFile(File zipFile,
File dirToExtractTo)
Unzips the zip file to the destination directory
|
static void |
unzipUrl(URL zipUrl,
File dirToExtractTo)
Unzips the zip url to the destination directory.
|
static String |
urlDecode(String url)
Deprecated.
since 6.10.0 Use
HtmlUtil.urlDecode(String) instead. |
static String |
urlEncode(String url)
Deprecated.
since 6.10.0 Use
HtmlUtil.urlEncode(String) instead. |
static String |
urlEncode(String value,
String encoding)
Deprecated.
since 6.10.0 Use
HtmlUtil.urlEncode(String, String) instead. |
static String |
wordWrap(String str,
int max)
For really long strings that have no spaces or line breaks, browsers such as firefox, Netscape, have difficulty
wrapping them inside a table cell, and so these strings end up stretching the cell longer than its suppose to be = ugly
|
@Deprecated public static void loadDefaultProperties()
BuildInformation
@Deprecated public static String format(Number number)
DateFormatter
number
- the number object to reformat@Deprecated public static String format(String str)
Strings.nullToEmpty(String)
instead@Deprecated public static String format(Object obj)
DateFormatter
or Strings.nullToEmpty(String)
insteadpublic static Date convertMailFormatDate(String date) throws ParseException
ParseException
public static boolean convertToBoolean(Object bool, boolean defaultValue)
public static String getOriginalUrl(javax.servlet.http.HttpServletRequest request)
@Deprecated public static String completeUrlEncode(String url)
HtmlUtil.completeUrlEncode(String)
instead.url
- - the entire URL to encode@Deprecated public static String urlEncode(String url)
HtmlUtil.urlEncode(String)
instead.url
- - part of the url to encode@Deprecated public static String urlEncode(String value, String encoding)
HtmlUtil.urlEncode(String, String)
instead.@Deprecated public static String urlDecode(String url)
HtmlUtil.urlDecode(String)
instead.@Deprecated public static boolean shouldUrlDecode(String str)
HtmlUtil.shouldUrlDecode(String)
instead.public static String getPageUrl(VersionHistorySummary summary)
public static String getPageUrl(AbstractPage page)
public static String getIdBasedPageUrl(AbstractPage page)
page
- the page to generate a url forpublic static String getEditPageUrl(AbstractPage page)
page
- the page to generate an edit url forpublic static String getAttachmentUrl(Attachment attachment)
attachment
- the attachment to generate an URL for.public static String getCommentUrl(Attachment attachment, Comment comment)
attachment
- the attachment that the annotation is on.comment
- the annotation to generate the url for.public static AbstractPage getParentPageOrBlog(Contained content)
content
- content to check for containing page or blog.public static Comment getParentComment(Comment comment)
comment
- comment to check for parent commentpublic static boolean isSafeTitleForUrl(String title)
title
- The title to checkpublic static boolean isSafeTitleForFilesystem(String title)
title
- The title to checkpublic static String customGetPageUrl(AbstractPage page)
page
- The page to get the URL of@Deprecated public static String appendAmpsandOrQuestionMark(String str)
appendAmpersandOrQuestionMark(String)
instead.str
- the string to prepare for adding a query param to.public static String appendAmpersandOrQuestionMark(String str)
str
- the string to prepare for adding a query param to.public static String wordWrap(String str, int max)
we want to simulate IE's word-wrap/break function here
str
- the string to wrapmax
- max length of string allowed per line@Deprecated public static String doubleUrlEncode(String url)
public static boolean isAllAscii(String s)
public static boolean isAllLettersOrNumbers(String s)
public static String getVersionNumber()
public static Date getBuildDate()
public static String getBuildDateString()
public static String getBuildNumber()
BuildInformation.getBuildNumber()
public static Long getSystemStartupTime()
public static void setSystemStartupTime(Long systemStartupTime)
public static boolean isLicenseExpired()
@Deprecated public static boolean hasTooManyUsers()
UserAccessor.isLicensedToAddMoreUsers()
@Deprecated public static boolean stringSet(String str)
StringUtils.isNotEmpty(CharSequence)
public static String formatLongTime(long time)
@Deprecated public static String formatDateFull(Date date)
DateFormatter
insteadpublic static Date toEndOfMonth(Calendar postDate, boolean isSqlServer)
postDate
- A calendar objectpublic static void copyDate(Calendar original, Calendar copy)
original
- The source calendar objectcopy
- The destination calendar object@Deprecated public static boolean isSuperUser(com.atlassian.user.User user)
user
- the user to check for (the null user will always return falsePermissionManager.hasPermission(com.atlassian.user.User, com.atlassian.confluence.security.Permission, java.lang.Object)
public static String getCharacterEncoding()
public static String cleanQuietly(String stringToClean)
<div><script>alert(1);</script></div>
will generate the following output,
<div></div>
stringToClean
- - the string might contain unsafe contents.public static String[] escapeXml(Object[] args)
String
s from a list of Objects. String.valueOf(Object)
is used
to produce String
s from the Object
sargs
- an array of objectsString
spublic static String escapeForJavascript(String s)
s
- the string to escapepublic static String escapeForHtmlAttribute(String s)
s
- the string to escapepublic static boolean isSetupComplete()
public static String maskEmail(String emailAddress)
Passing in null to this method will just get you null back
emailAddress
- the email address to maskpublic static String maskEmail(String emailAddress, Settings globalSettings, I18NBean i18NBean)
public static String alwaysMaskEmail(String emailAddress)
emailAddress
- an email address to mask, eg dwillis@atlassian.compublic static String findAndMaskEmail(String text, com.atlassian.user.User currentUser)
public static File createTempDirectoryInConfluenceTemp(String prefix)
public static String hackSingleQuotes(String s)
s
- the input stringpublic static boolean isInLastDays(Date date, int maxDays)
date
- the date to checkmaxDays
- the number of days into the past the date can fallpublic static String getRelativeTime(Date date)
FriendlyDateFormatter
date
- the date to convert to a relative time stringpublic static javax.servlet.http.Cookie setCookie(String key, String value)
key
- the key of the cookievalue
- the value of the cookiepublic static String getCookieValue(javax.servlet.http.HttpServletRequest request, String key)
@Deprecated public static String htmlEncode(String text)
HtmlUtil.htmlEncode(String)
instead)@Deprecated public static String htmlEncodeAndReplaceSpaces(String text)
HtmlUtil.htmlEncodeAndReplaceSpaces(String)
instead)public static String plain2html(String text)
text
- the text to encodePlainTextToHtmlConverter
public static void unzipFile(File zipFile, File dirToExtractTo) throws IOException
zipFile
- the zip file to extractdirToExtractTo
- the directory to extract the zip file toIOException
- if an IOException occurspublic static Unzipper getUnzipper(File zipFile, File dirToExtractTo) throws IOException
IOException
public static void unzipUrl(URL zipUrl, File dirToExtractTo) throws IOException
zipUrl
- the URL of the zip file to extractdirToExtractTo
- the directory to extract the zip file toIOException
- if an IOException occurspublic static String getUploadFileTooLargeMessage(String errorMessage)
errorMessage
- the error message to convertpublic static ResourceBundle getDefaultResourceBundle()
public static int arraySize(int[] array)
array
- the array to find the length of@Nullable public static String escapeXMLCharacters(@Nullable String input)
input
- a string to escape for XMLpublic static String replaceInvalidXmlCharacters(String text)
Note that this method does not "escape" the string (e.g. "&" is not converted to "&").
Similar to Verifier.checkCharacterData(String)
but converts illegals instead of throwing Exceptions.
text
- the input stringpublic static String htmlEscapeQuotes(String input)
null
input will be returned as an empty String.
input
- string to escapepublic static <T> List<T> filterNulls(Collection<T> in)
in
- a collection to filter nullspublic static String shortenString(String str, int max)
ELLIPSIS
to the end of the
string if it does truncate it.str
- the string to shortenmax
- the maximum desired length of the result (excluding ELLIPSIS
)StringUtils.abbreviate(String, int)
public static String specialToLowerCase(String str)
lower(page.title) = :pageTitle
(Where :pageTitle is normally .toLowerCase() first before being passed in)
This special lower case function will skip the JAVA .toLowerCase() for postgres whose database lower() is ineffective.
str
- the string to convert to lower case@Deprecated public static String replaceConfluenceHomeConstant(String in, String confHome)
replaceConfluenceConstants(String, java.io.File, java.io.File)
instead.public static String replaceConfluenceConstants(String in, File home, File localHome)
ConfluenceBootstrapConstants.CONFLUENCE_HOME_CONSTANT
and ConfluenceBootstrapConstants.CONFLUENCE_LOCAL_HOME_CONSTANT
in the given text with the correct paths.in
- text to make the replacements tohome
- Confluence home directorylocalHome
- Confluence local home directorypublic static Collection<String> specialLowerCaseCollection(Collection<String> collection)
collection
- the collectionpublic static String summarise(String content)
content
- the content to summarisepublic static com.atlassian.bonnie.search.summary.Summary makeSummary(String content)
content
- the string to summariseSummarizer
public static com.atlassian.bonnie.search.summary.Summary makeSummary(String content, @Nullable String query)
content
- the string to summarisequery
- the lucene querySummarizer
public static String makeFlatSummary(String content)
content
- the content to summariseSummarizer
public static String makeFlatSummary(String content, @Nullable String query)
content
- the content stringquery
- the lucene query stringSummarizer
public static UserAccessor getUserAccessor()
public static void setUserAccessor(UserAccessor userAcc)
public static com.atlassian.core.util.ImageInfo getImageInfo(File pathToImage)
public static String getNiceDuration(int minutes, int seconds)
public static String getCompactDuration(long time)
time
- duration in millisecondspublic static ConfluenceActionSupport newWiredConfluenceActionSupport()
public static void profilePush(String s)
public static void profilePop(String s)
public static String lookupDomainName(javax.servlet.http.HttpServletRequest request)
request
- the requestpublic static Settings getGlobalSettings()
@Deprecated public static String personalSpaceUrl(String contextPath, String username)
SpaceManager
and call getUrlPath on the Space object. Also note that if a user has been renamed (which is possible
from Confluence 5.3 onwards) then this method is likely to return the wrong key.public static long getPercentage(long numerator, long denom)
numerator
- the number to include in the percentagedenom
- the total number@Deprecated public long subtract(long a, long b)
@Deprecated public long subtract(String firstOperandAsString, String secondOperandAsString)
@Deprecated public static String getConfluenceTempDirectoryPath()
getLocalTempDirectory()
instead.@Deprecated public static File getConfluenceTempDirectory()
getLocalTempDirectory()
instead.public static File getLocalTempDirectory()
public static File getSharedTempDirectory()
public static String[] splitCommaDelimitedString(String escapedNames)
escapedNames
- Comma delimited string with original commas and backslashes escaped by backslashespublic static List<String> escapeCommas(List<String> toEscape)
public static String escapeCommas(String toEscape)
toEscape
- string to escape. If null, then null will be returned.public static String constrainLength(String s, int length)
s
- The String to truncatelength
- The maximum length allowed.@Deprecated public static boolean isOutgoingMailConfigured()
MailServerManager.isDefaultSMTPMailServerDefined()
instead.public static Map<String,String> convertBeanToMap(Object bean)
bean
- a bean to be converted to a Map.public static <K,V> Map<K,V> prefixAllMapKeys(String prefix, Map<K,V> map)
If any of the keys in the Map are not Strings then they will be ignored.
prefix
- the prefix to be pre-pended to each Map key, if null then the original Map will be returned.map
- the Map to be modified. If null, then an empty Map will be returned.@Deprecated public static boolean isDefaultUserProfilePicture(String username)
UserAccessor.getUserProfilePicture(com.atlassian.user.User)
.username
- the username to checkpublic static String rdfEncode(String s)
s
- to encodepublic static String populateSimpleMessage(String template, List<String> values)
Populate the template String supplied using the given values. The template may contain place holders which are
denoted numerically in the form {n}
where n is an index into the supplied values list.
e.g. "The template called {1} will expects a colour here {0}".
This template will use value 0 and value 1 from the supplied values array. If the referenced value cannot be found then the place holder will simply be removed.
template
- the template to be populatedvalues
- the values used to populate the templatepublic static <T> List<T> getRandomSubSet(List<T> list, int sizeOfSubset, Random random)
list
- - the list to subsetsizeOfSubset
- - the size of the subset to returnrandom
- - the source of randomnesspublic static boolean isDateWithin24Hours(Date date)
date
- public static String refineOsDestination(String osDestination)
osDestination
- public static String removeEmailsFromString(String text)
text
- public static Duration getServerRenderTime(javax.servlet.http.HttpServletRequest servletRequest)
public static String getRequestCorrelationId()
public static void flushResponse()
public static void elapse(String tag)
HttpRequestStats
Copyright © 2003–2018 Atlassian. All rights reserved.