private static String get(File profileFile, String field) throws HyscaleException {
        if (profileFile == null) {
            return null;
        }
        try {
            Profile profile = new Profile(FileUtils.readFileToString(profileFile, ToolConstants.CHARACTER_ENCODING));
            JsonNode fieldValue = profile.get(field);
            if (fieldValue == null) {
                HyscaleException hyscaleException = new HyscaleException(
                        ServiceSpecErrorCodes.MISSING_FIELD_IN_PROFILE_FILE, field);
                logger.error(hyscaleException.getMessage());
                throw hyscaleException;
            }
            return fieldValue.asText();
        } catch (IOException e) {
            logger.error(e.getMessage());
            throw new HyscaleException(CommonErrorCode.FAILED_TO_READ_FILE, profileFile.getPath());
        }
    }
Gets profile name from profile file.
1.returns profile name if present with the key @HyscaleSpecFields#environment.
2.else returns null when file is null or throws relevant HyscaleException.

@param profileFile
@return profile or environment name
@throws HyscaleException
workflow-controller/controller-service/src/main/java/io/hyscale/controller/util/ServiceProfileUtil.java