Skip to content
A small library for the generation of Gravatar URLs http://www.bripkens.de
Java
Find file
Latest commit c85e38b @bripkens Update .gitignore
Remove IDE specific ignore information.
Failed to load latest commit information.
src Styles fixes
.gitignore Update .gitignore
LICENSE Initial commit.
README.md update version
pom.xml [maven-release-plugin] prepare for next development iteration

README.md

Gravatar4Java

A small library for the generation of Gravatar URLs.

Usage

Gravatar4Java is a Maven project and available in Maven Central. Just add the Gravatar4Java dependency to your pom.xml and you are done!

<dependency>
    <groupId>de.bripkens</groupId> 
    <artifactId>gravatar4java</artifactId> 
    <version>1.2</version> 
</dependency>

Example

import de.bripkens.gravatar.DefaultImage;
import de.bripkens.gravatar.Gravatar;
import de.bripkens.gravatar.Rating;

String gravatarImageURL = new Gravatar()
    .setSize(50)
    .setHttps(true)
    .setRating(Rating.PARENTAL_GUIDANCE_SUGGESTED)
    .setStandardDefaultImage(DefaultImage.MONSTER)
    .getUrl("foobar@example.com");

Spring example

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:p="http://www.springframework.org/schema/p">

    <!-- Gravatar -->
    <bean id="gravatar"
          class="de.bripkens.gravatar.Gravatar"
          p:size="75"
          p:rating="GENERAL_AUDIENCE"
          p:standardDefaultImage="MONSTER" />

</beans>
Something went wrong with that request. Please try again.