Here you can find the source of shortenFileName(String name)
public static String shortenFileName(String name)
//package com.java2s; /*/*w w w. j a v a 2s. co m*/ * JBoss, Home of Professional Open Source. * * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing. * * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors. */ public class Main { public static String shortenFileName(String name) { if (name == null) return name; String retVal; String tempStr = name.replace('\\', '/'); if (tempStr.indexOf('/') >= 0) { retVal = tempStr.substring(tempStr.lastIndexOf('/') + 1); } else { retVal = name; } return retVal; } }