public static String parseFileName(String s) {
      String fileName = s;
      fileName = fileName.replace('/', File.separatorChar);
      fileName = fileName.replace('\\', File.separatorChar);
      int i = fileName.lastIndexOf('.');
      if (i > 0) {
         fileName = fileName.substring(0, i).replace('.', File.separatorChar) + fileName.substring(i);
      }
      if (fileName.lastIndexOf(File.separatorChar) >= 0) {
         fileName = fileName.substring(fileName.lastIndexOf(File.separatorChar) + 1);
      }
      if (fileName.lastIndexOf(".") >= 0) {
         fileName = fileName.substring(0, fileName.lastIndexOf("."));
      }
      return fileName;
   }