sdk-java


Лицензия

Лицензия

MIT
Категории

Категории

Java Языки программирования Сеть
Группа

Группа

net.koofr
Идентификатор

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

sdk-java
Последняя версия

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

0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

sdk-java
sdk-java
Ссылка на сайт

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

https://github.com/koofr/java-koofr
Организация-разработчик

Организация-разработчик

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

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

https://github.com/koofr/java-koofr.git

Скачать sdk-java

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

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

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
org.apache.httpcomponents : httpclient jar 4.2.1
org.restlet.jse » org.restlet.ext.jackson jar 2.1.2
org.restlet.jse » org.restlet.ext.httpclient jar 2.1.2

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

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

Koofr Java SDK

This is a Java SDK for easy interaction with Koofr service. See the examples folder for a quick start.

A Quick Start

import net.koofr.api.auth.Authenticator;
import net.koofr.api.auth.basic.HttpBasicAuthenticator;
import net.koofr.api.http.Client;
import net.koofr.api.rest.v2.Api;

public class Main {

  public static void main(String args[]) {

    Client c = new BasicClient();
    Authenticator a = new HttpBasicAuthenticator("username", "password");
    Api api = new Api("https://app.koofr.net/api/v2", a, c);

    Self self = api.self().get();
    
  }

}

Obviously, you need an HTTP Client and an Authenticator to use the Api.

The SDK provides an abstraction for both. You probably won't need to implement your own authenticator since the ones supplied in net.kofr.api.auth subpackages cover all possible authentication options you have with Koofr: OAuth2, HTTP Basic and our own authentication token scheme.

You might want to implement your own HTTP client on the other hand: we provide a simple one based on the HttpURLConnection class from the Java runtime, but you might want to use an Apache HttpComponents based one or whatever the preferred option on your platform is. You're welcome, you just need to implement the Client, Request and Response interfaces.

Examples

There are two examples demonstrating use of a Koofr client. Run them via SBT.

sbt
project info
run app.koofr.net myemail@example.com mypassword

or

sbt
project cmdline
run app.koofr.net myemail@example.com mypassword

Hostname is passed in without protocol and without any slashes.

You can also use OAuth2-based authentication in the examples, by replacing the username and password with token URL, client ID, client secret and grant code. However, you need to get the grant code before running the examples: perhaps with curl or with OAuth Playground

Building

To build jars use

sbt package

Maven

Prebuilt jars are available for maven at JCenter, group ID net.koofr, artefact ID java-koofr

net.koofr

Koofr

Because my data matters.

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

Версия
0.1