public static String stripMetaFromName(String fileName){
  int end=fileName.indexOf(",S=");
  if (end == -1)   end=fileName.indexOf(":2,");
  if (end == -1)   return fileName;
  return fileName.substring(0,end);
}

public static String stripMetaFromName ( String fileName ) { int end = fileName . indexOf ( ",S=" ) ; if ( end == - 1 ) end = fileName . indexOf ( ":2," ) ; if ( end == - 1 ) return fileName ; return fileName . substring ( 0 , end ) ; }
takes the name of a message file and returns only the base name .
