Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

aaschmid/taskwarrior-java-client

Open more actions menu

Repository files navigation

Travis CI CircleCI codebeat Maven Central License Issues

taskwarrior-java-client

Table of Contents

What is it

A Java client to communicate with a taskwarrior server (= taskd).

Motivation and distinction

The current taskwarrior Android app does not satisfy my requirements. Therefore I created this client library to integrate it into my preferred task app. And I also want to share it with everybody who will love to use it.

Requirements

  • JDK 8

Download

Currently there is no released version available but feel free to clone / fork and build it yourself. If you would love to see this on Maven Central feel free to create an issue.

Usage example

For example using it with Java:

import java.io.IOException;
import java.net.URL;

import de.aaschmid.taskwarrior.TaskwarriorClient;
import de.aaschmid.taskwarrior.config.TaskwarriorConfiguration;
import de.aaschmid.taskwarrior.message.MessageType;
import de.aaschmid.taskwarrior.message.TaskwarriorMessage;
import de.aaschmid.taskwarrior.message.TaskwarriorRequestHeader;

import static de.aaschmid.taskwarrior.config.TaskwarriorConfiguration.taskwarriorPropertiesConfiguration;
import static de.aaschmid.taskwarrior.message.TaskwarriorMessage.taskwarriorMessage;
import static de.aaschmid.taskwarrior.message.TaskwarriorRequestHeader.taskwarriorRequestHeaderBuilder;

class Taskwarrior {

    private static final URL PROPERTIES_TASKWARRIOR = Taskwarrior.class.getResource("/taskwarrior.properties");

    public static void main(String[] args) {
        if (PROPERTIES_TASKWARRIOR == null) {
            throw new IllegalStateException(
                    "No 'taskwarrior.properties' found on Classpath. Create it by copy and rename 'taskwarrior.properties.template'. Also fill in proper values.");
        }
        TaskwarriorConfiguration config = taskwarriorPropertiesConfiguration(PROPERTIES_TASKWARRIOR);

        TaskwarriorRequestHeader header = taskwarriorRequestHeaderBuilder().authentication(config).type(MessageType.STATISTICS).build();
        TaskwarriorMessage message = taskwarriorMessage(header.toMap());

        TaskwarriorClient client = new TaskwarriorClient(config);

        TaskwarriorMessage response = client.sendAndReceive(message);
        System.out.println(response);
    }
}

Used taskwarrior.properties can be created by copying and adjusting src/main/resources/taskwarrior.properties.template.

Testing

To run tests manually you will need to build and run taskwarrior server container. See here how.

Keys formats

Key specification PEM format¹ DER format
PKCS#1 yes
PKCS#8 yes yes

¹: The kind of format is currently detected by file extentions.

Note: Keys can be transformed using openssl, e.g. from PKCS#8 in PEM format to PKCS#1 in DER format:

openssl pkcs8 -topk8 -nocrypt -in $TASKD_GENERATED_KEY.key.pem -inform PEM -out $KEY_NAME.key.pkcs8.der -outform DER

Release notes

Releases and Release Notes are available here.

About

A Java client to communicate with a taskwarrior server (= taskd).

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Morty Proxy This is a proxified and sanitized view of the page, visit original site.