in pekko-connectors-sample-rotate-logs-to-ftp/src/main/java/playground/filesystem/impl/JimfsFtpFile.java [67:87]
public String getName() {
// root - the short name will be '/'
if (fileName.equals("/")) {
return "/";
}
// strip the last '/'
String shortName = fileName;
int filelen = fileName.length();
if (shortName.charAt(filelen - 1) == '/') {
shortName = shortName.substring(0, filelen - 1);
}
// return from the last '/'
int slashIndex = shortName.lastIndexOf('/');
if (slashIndex != -1) {
shortName = shortName.substring(slashIndex + 1);
}
return shortName;
}