private static String shorten(String path){
  int idx1=path.lastIndexOf('/');
  int idx2=path.lastIndexOf('\\');
  int idx=Math.max(idx1,idx2);
  return idx == -1 ? path : path.substring(idx + 1);
}

private static String shorten ( String path ) { int idx1 = path . lastIndexOf ( '/' ) ; int idx2 = path . lastIndexOf ( '\\' ) ; int idx = Math . max ( idx1 , idx2 ) ; return idx == - 1 ? path : path . substring ( idx + 1 ) ; }
get filename from path .
