GithubHelp home page GithubHelp logo

ckaratzas / tus-server-implementation Goto Github PK

View Code? Open in Web Editor NEW
13.0 2.0 1.0 31 KB

A java implementation of https://tus.io/protocols/resumable-upload.html protocol with vertx-web.

License: MIT License

Shell 6.28% Java 93.72%
tus-protocol vertx-web openapi3

tus-server-implementation's Introduction

TUS Server Java Implementation

An implementation of the Tus Resumable Upload protocol [https://tus.io/protocols/resumable-upload.html] in java. Vertx-Web is used for the http stack part and redis as the backend for upload information management. Extensions supported are creation,checksum,termination,concatenation. The purpose of this repository is to provide a Tus protocol implementation agnostic of the underlying storage provider thus allowing implementors to focus on their business logic and specific needs. An issue that is not a concern of the protocol but could be an extension is the handling of the locks during a patch operation. So when a patch is initiated a lock is acquired (for most obvious cases) to ensure consistency. If the process triggered from patch fails and lock is not released there is a phantom lock remaining. This edge case could be mitigated by either making the server sticky and keeping the locks in-process or by perhaps issuing a release request with a lock token obtained by the initiator of the upload. No authentication valves are implemented here also.

Instructions

To just build the tus-server-implementation just:

cd <root>

mvn clean install

To build the docker image for the tus-server-implementation just (docker edge release [https://docs.docker.com/edge/] is required!):

cd <root>

docker build -t tus_server .

In order to run tus-server-implementation along with all dependencies just (assuming you already have the docker image built from above):

cd <root>

docker-compose -f tus-server.yml up

In order to setup the tus-server-implementation for development from your favorite IDE redis running is required:

cd <root>

docker-compose -f redis.yml up

After that in order to run the tus-server-implementation from inside your favorite IDE just: Run the com.tus.oss.server.application.Application main class with program arguments: -c /configuration/ -b tus-server-beans.xml and VM parameters: -Dlogging.config=file:/configuration/logback.xml Redis must be live also (see above how to run it)

Testing

In the test folder: There is a very simple upload test that uses tus-java-client [https://github.com/tus/tus-java-client]. There are also curl tests that test simple upload and partial uploads (concatenation extension)

tus-server-implementation's People

Contributors

ckaratza avatar ckaratzas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

duhbera

tus-server-implementation's Issues

The method or(() -> {}) is undefined for the type Optional<OpenAPI>

Hi,

Could you please help how to compile this project. As i have gone through your instrictions, but it seems this method is not available in Optional class.

I am using jdk 1.8-144 and IDE is eclipse.

changed the copiler to 1.8.144.

OpenApiRoutePublisher.java

Optional spec = Optional.ofNullable(generatedSpecs.get(path)).or(() -> {
OpenAPI openAPI = OpenApiSpecGenerator.generateOpenApiSpecFromRouter(router, title, version, serverUrl);
generatedSpecs.put(path, openAPI);
return Optional.of(openAPI);
});

HeadHandler.java

uploadManager.findUploadInfo(uploadID).or(() -> {
response.setStatusCode(404);
return Optional.empty();
}).ifPresent(info -> {

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.