While validating the given string text is of Hmm format getting this error
java.text.ParseException: Unparseable date: "1637"
but this is working for text "747".
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
    public class Validation{
    
         public void validateDateFormat(String format,String text){
              SimpleDateFormat sdfrmt = new SimpleDateFormat(format);
              sdfrmt.setLenient(false);
              Date testDate = null;
              try {
                    testDate = sdfrmt.parse(text);
    
              } catch (ParseException e) {
                    System.out.println("dateFormat Exception :");
                    e.printStackTrace();
            }
         }
         
         public static void main(String []args){
            Validation val = new Validation();
            val.validateDateFormat("Hmm","747"); //working 
            val.validateDateFormat("Hmm","1637");//not working
         }
    }
This is for validating the given columns from the uploaded file.So wrote this to be dynamic based on the format written in the config for each column.
 
     
    