1
0
mirror of https://github.com/sismics/docs.git synced 2025-12-15 10:46:26 +00:00

#41: DB: Storage quota and current usage, accessible from /user

This commit is contained in:
jendib
2015-11-24 00:30:01 +01:00
parent dd671795e6
commit 1cae964c09
12 changed files with 107 additions and 96 deletions

View File

@@ -155,7 +155,23 @@ public class ValidationUtil {
try {
return Integer.valueOf(s);
} catch (NumberFormatException e) {
throw new ClientException("Validation Error", MessageFormat.format("{0} is not a number", name));
throw new ClientException("ValidationError", MessageFormat.format("{0} is not a number", name));
}
}
/**
* Checks if the string is a number.
*
* @param s String to validate
* @param name Name of the parameter
* @return Parsed number
* @throws ClientException
*/
public static Long validateLong(String s, String name) throws ClientException {
try {
return Long.valueOf(s);
} catch (NumberFormatException e) {
throw new ClientException("ValidationError", MessageFormat.format("{0} is not a number", name));
}
}