class ExternalService {

    public String getToken(){
        String token="";
        ObjectMapper objectMapper=new ObjectMapper();
        try{
            File file=new ClassPathResource("env.json").getFile();
            if(!file.exists()){
                System.out.println("Invalid Access Token Provided... Copy the content of env.example.json to env.json and update the access token");
                return "An error occurred with the Access Token Provided";
            }

            Map<String,Object> dataMap=objectMapper.readValue(file,HashMap.class);
            token=(String)dataMap.get("token");
        }
        catch (Exception ex){
            ex.printStackTrace();
        }

        return token;
    }

}