public class ContentLimiter extends Object
Modifier and Type | Field and Description |
---|---|
protected static String |
CONTENT_EXCEEDED_TEXT |
static int |
MB |
protected static int |
REQUEST_RESPONSE_LIMIT |
protected static String |
RUN_EXCEEDED_TEXT |
protected static int |
TOTAL_RUN_HARD_LIMIT |
protected static int |
TOTAL_RUN_SOFT_LIMIT |
Constructor and Description |
---|
ContentLimiter() |
Modifier and Type | Method and Description |
---|---|
byte[] |
replaceContentIfLimitsExceeded(String content,
int totalSizeOfRun)
Replaces a string with a placeholder if the length of the string exceeds the limit.
|
public static final int MB
protected static final int REQUEST_RESPONSE_LIMIT
protected static final int TOTAL_RUN_SOFT_LIMIT
protected static final int TOTAL_RUN_HARD_LIMIT
protected static final String CONTENT_EXCEEDED_TEXT
protected static final String RUN_EXCEEDED_TEXT
public byte[] replaceContentIfLimitsExceeded(String content, int totalSizeOfRun)
content
- the content to checktotalSizeOfRun
- the total size of the current runCopyright © 2019. All rights reserved.