/** * Validates the {@code GoogleClientSecrets} object. * @throws ValidationException if the {@code GoogleClientSecrets} did not * validate */ private void validate() throws ValidationException { if (Strings.isNullOrEmpty(clientId) || clientId.startsWith("INSERT_CLIENT_ID_HERE")) { throw new ValidationException(String.format( "Client ID must be set%s\nIf you do not have a client ID or secret, " + "please create one in the API console: https://console.developers.google.com", filePath != null ? generateFilePathWarning("clientId") : "."), "clientId"); } if (Strings.isNullOrEmpty(clientSecret) || clientId.startsWith("INSERT_CLIENT_SECRET_HERE")) { throw new ValidationException(String.format( "Client secret must be set%s\nIf you do not have a client ID or secret, " + "please create one in the API console: https://console.developers.google.com", filePath != null ? generateFilePathWarning("clientSecret") : "."), "clientSecret"); } }
/** * Validates the {@code GoogleClientSecrets} object. * @throws ValidationException if the {@code GoogleClientSecrets} did not * validate */ private void validate() throws ValidationException { if (Strings.isNullOrEmpty(clientId) || clientId.startsWith("INSERT_CLIENT_ID_HERE")) { throw new ValidationException(String.format( "Client ID must be set%s\nIf you do not have a client ID or secret, " + "please create one in the API console: https://console.developers.google.com", filePath != null ? generateFilePathWarning("clientId") : "."), "clientId"); } if (Strings.isNullOrEmpty(clientSecret) || clientId.startsWith("INSERT_CLIENT_SECRET_HERE")) { throw new ValidationException(String.format( "Client secret must be set%s\nIf you do not have a client ID or secret, " + "please create one in the API console: https://console.developers.google.com", filePath != null ? generateFilePathWarning("clientSecret") : "."), "clientSecret"); } }