Here you can find the source of shortenName(final String fullName)
static protected String shortenName(final String fullName)
//package com.java2s; public class Main { static protected String shortenName(final String fullName) { String result;//from w w w . jav a 2 s. co m if (fullName.isEmpty()) { result = ""; } else { result = removePrefix(fullName); result = cleanSuffix(result); } return result; } static public String removePrefix(final String name) { String result = name; if (name.contains("#")) { result = name.replaceAll(".*#", ""); } return result; } static public String cleanSuffix(final String name) { String result = name; if (name.endsWith("/")) { result = result.substring(0, result.length() - 1); } final int lastPos = result.lastIndexOf("/", result.length()); if (lastPos != -1) { result = result.substring(lastPos + 1, result.length()); } return result; } }