https://github.com/irods/irods_client_http_java
Java wrapper for iRODS HTTP API
https://github.com/irods/irods_client_http_java
Last synced: 10 months ago
JSON representation
Java wrapper for iRODS HTTP API
- Host: GitHub
- URL: https://github.com/irods/irods_client_http_java
- Owner: irods
- Created: 2024-06-13T16:11:16.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-23T01:19:30.000Z (almost 2 years ago)
- Last Synced: 2025-01-15T01:42:08.994Z (over 1 year ago)
- Language: Java
- Homepage:
- Size: 306 KB
- Stars: 0
- Watchers: 4
- Forks: 1
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# iRODS Java HTTP API Wrapper
Java client library designed and developed to wrap the new iRODS HTTP API. It provides java classes to cleanly interact
with all the functionality of the HTTP API and comes with tests and packaging.
## Usage Example
The following example demonstrates how to create and remove a collection.
```java
String baseUrl = "http://:/irods-http-api/";
// Create an instance of the IrodsHttpClient with the specified base URL.
IrodsHttpClient client = new IrodsHttpClient(baseUrl);
// All methods return a `Response` object, which holds the HTTP status code and the
// body of the response (as JSON). Can be retrieved by using `.getHttpStatusCode()`
// and `.getBody()`, respectively. You can parse the JSON response body using your
// preferred JSON parsing library or method.
// Authenticate a user. An authentication request has a response body containing the
// bearer token that can be used to execute operations as the authenticated user.
Response res = client.authenticate(, );
String bearerToken = res.getBody();
// All methods can be called using a method chaining approach. On the client object,
// you chain the endpoint name (e.g. collections), and then chain the operation name
// (e.g. createCollection).
// We will create a collection. We don't want to use the createIntermediates field,
// so we pass it an empty OptionalInt.
String logicalPath = "/tempZone/home/