mirror of
https://github.com/valitydev/file-storage.git
synced 2024-11-06 00:35:22 +00:00
add validate condition for string parameters (#12)
This commit is contained in:
parent
0bc9c035ea
commit
8a631d9948
@ -5,7 +5,7 @@ import com.google.common.base.Strings;
|
||||
public class CheckerUtil {
|
||||
|
||||
public static void checkString(String string, String exMessage) throws IllegalArgumentException {
|
||||
if (Strings.isNullOrEmpty(string)) {
|
||||
if (Strings.isNullOrEmpty(string) || string.contains(" ")) {
|
||||
throw new IllegalArgumentException(exMessage);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user