CloudSponge API Java Wrapper

Java Wrapper for the CloudSponge.com REST API. CloudSponge is the tool that you need to go viral. Create an account at http://www.cloudsponge.com and integrate with this library. In a few lines of code you'll have access to your users' contact lists.

License

License

GroupId

GroupId

com.cloudsponge
ArtifactId

ArtifactId

cloudsponge
Last Version

Last Version

1.0-RC2
Release Date

Release Date

Type

Type

jar
Description

Description

CloudSponge API Java Wrapper
Java Wrapper for the CloudSponge.com REST API. CloudSponge is the tool that you need to go viral. Create an account at http://www.cloudsponge.com and integrate with this library. In a few lines of code you'll have access to your users' contact lists.
Project URL

Project URL

https://github.com/andrenpaes/cloudsponge-lib-java
Source Code Management

Source Code Management

https://github.com/andrenpaes/cloudsponge-lib-java/tree/master/

Download cloudsponge

How to add to project

<!-- https://jarcasting.com/artifacts/com.cloudsponge/cloudsponge/ -->
<dependency>
    <groupId>com.cloudsponge</groupId>
    <artifactId>cloudsponge</artifactId>
    <version>1.0-RC2</version>
</dependency>
// https://jarcasting.com/artifacts/com.cloudsponge/cloudsponge/
implementation 'com.cloudsponge:cloudsponge:1.0-RC2'
// https://jarcasting.com/artifacts/com.cloudsponge/cloudsponge/
implementation ("com.cloudsponge:cloudsponge:1.0-RC2")
'com.cloudsponge:cloudsponge:jar:1.0-RC2'
<dependency org="com.cloudsponge" name="cloudsponge" rev="1.0-RC2">
  <artifact name="cloudsponge" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.cloudsponge', module='cloudsponge', version='1.0-RC2')
)
libraryDependencies += "com.cloudsponge" % "cloudsponge" % "1.0-RC2"
[com.cloudsponge/cloudsponge "1.0-RC2"]

Dependencies

compile (2)

Group / Artifact Type Version
org.apache.httpcomponents : httpclient jar 4.2.1
commons-lang : commons-lang jar 2.6

provided (1)

Group / Artifact Type Version
javax.servlet : servlet-api jar 2.5

test (4)

Group / Artifact Type Version
junit : junit jar 4.10
org.mockito : mockito-core jar 1.9.0
commons-io : commons-io jar 2.4
org.mortbay.jetty : jetty-servlet-tester jar 6.1.26

Project Modules

There are no modules declared in this project.

cloudsponge-lib-java Build Status

Java Wrapper for the CloudSponge.com Rest API

CloudSponge is the tool that you need to go viral. Create an account at http://www.cloudsponge.com and integrate with this library. In a few lines of code you'll have access to your users' contact lists.

How to Use it

First add it to your pom.xml

<dependency>
  <groupId>com.cloudsponge</groupId>
  <artifactId>cloudsponge</artifactId>
  <version>1.0-RC2</version>
</dependency>

Or, if you're not using Maven, download the single jar or the jar with all included dependencies and add it your project.

Then use it!

CloudSpongeApiFactory factory = new CloudSpongeApiFactoryImpl("DOMAIN_KEY", "DOMAIN_PASSWORD");

CloudSpongeApi<UserConsent> cloudSponge = factory.create(ContactsService.GMAIL);
// For AOL use:
// final CloudSpongeApi<ImportResponse> cloudSponge = factory.create(ContactsService.AOL);
// cloudSponge.userName("me").userPassword("test").beginImport();

try {
	UserConsent consent = cloudSponge.beginImport();
	// Manually open the consent page in a browser window to continue with the import
	System.out.println("Copy and paste the following URL into your favorite browser to continue with the import:");
	System.out.println(consent.getUrl());

	// Waiting for consent...
	ProgressEvents progress = cloudSponge.getImportProgress();
	while (!progress.isDone()) {
		progress = cloudSponge.getImportProgress();
		Thread.sleep(1000);
	}

	Event completeEvent = progress.getEvent(EventType.COMPLETE);
	if (completeEvent.getStatus() == EventStatus.ERROR) {
		System.out.println("Error: " + completeEvent.getValue());
	} else {
		UserContacts userContacts = cloudSponge.fetchContacts();
		Contact owner = userContacts.getOwner();
		System.out.println(owner);
		for (Contact contact : userContacts.getContacts()) {
			System.out.println(contact);
		}
	}
} finally {
	cloudSponge.close();
}

CloudSponge Proxy URL

The CloudSponge API Java Wrapper also includes an implementation of a Proxy URL for branding the user authentication process. For more the details, click here.

For using the Proxy URL Servlet, just add it to your web.xml file

<servlet>
	<servlet-name>CloudSponge URL Proxy</servlet-name>
	<servlet-class>com.cloudsponge.CloudSpongeProxyServlet</servlet-class>
</servlet>
<servlet-mapping>
	<servlet-name>CloudSponge URL Proxy</servlet-name>
	<url-pattern>URL_PATTERN</url-pattern>
</servlet-mapping>

Versions

Version
1.0-RC2
1.0-RC1