clean code
This commit is contained in:
parent
85cafb7257
commit
e0d3fc23ed
|
|
@ -26,26 +26,6 @@ public final class EleCommonUtil {
|
||||||
|
|
||||||
private static EleLog log = new EleLog(EleCommonUtil.class);
|
private static EleLog log = new EleLog(EleCommonUtil.class);
|
||||||
|
|
||||||
public static String getFileName(String fileFullName) {
|
|
||||||
if (fileFullName == null) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
if (!fileFullName.contains(".")) {
|
|
||||||
return fileFullName;
|
|
||||||
}
|
|
||||||
|
|
||||||
int index = fileFullName.lastIndexOf(".");
|
|
||||||
return fileFullName.substring(0, index);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getFileType(String fileFullName) {
|
|
||||||
if (fileFullName == null || !fileFullName.contains(".")) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
int index = fileFullName.lastIndexOf(".");
|
|
||||||
return fileFullName.substring(index + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isFileNameValid(String fileFullName) {
|
public static boolean isFileNameValid(String fileFullName) {
|
||||||
if (StrUtil.isEmpty(fileFullName) || fileFullName.length() > 32) {
|
if (StrUtil.isEmpty(fileFullName) || fileFullName.length() > 32) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue