Done ticket GEPAFINBE-8
This commit is contained in:
@@ -46,4 +46,17 @@ public class Utils {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static String extractFileName(String filePath) {
|
||||
if (filePath == null || filePath.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
int lastSlashIndex = filePath.lastIndexOf('/');
|
||||
|
||||
if (lastSlashIndex >= 0 && lastSlashIndex < filePath.length() - 1) {
|
||||
return filePath.substring(lastSlashIndex + 1);
|
||||
} else {
|
||||
return filePath;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user