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.

Лицензия

Лицензия

Группа

Группа

com.cloudsponge
Идентификатор

Идентификатор

cloudsponge
Последняя версия

Последняя версия

1.0-RC2
Дата

Дата

Тип

Тип

jar
Описание

Описание

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.
Ссылка на сайт

Ссылка на сайт

https://github.com/andrenpaes/cloudsponge-lib-java
Система контроля версий

Система контроля версий

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

Скачать cloudsponge

Как подключить последнюю версию

<!-- 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"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.apache.httpcomponents : httpclient jar 4.2.1
commons-lang : commons-lang jar 2.6

provided (1)

Идентификатор библиотеки Тип Версия
javax.servlet : servlet-api jar 2.5

test (4)

Идентификатор библиотеки Тип Версия
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

Модули Проекта

Данный проект не имеет модулей.

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>

Версии библиотеки

Версия
1.0-RC2
1.0-RC1