Thanks to visit codestin.com
Credit goes to github.com

Skip to content

nicholasadamou/java-ftp-service

Repository files navigation

java-ftp-service

The java-ftp-service is a Java Spring Boot application that provides an API for sending files to a remote server via SFTP.

API

URL: /sftp

Method: POST

Consumes: Multipart Form Data

Request Header(s): Authorization

Success Response

Code: 200 OK

Development

Requirements

Steps

Create a .env file with the following properties using the env.example as an example:

MAVEN_USERNAME=user
MAVEN_PASSWORD=pass

TRUSTSTORE=base64encodedtruststore
TRUSTSTORE_PASSWORD=password

KEYSTORE=base64encodedkeystore
KEYSTORE_PASSWORD=password

CORS_ALLOWED_ORIGINS=https://localhost:3000

FTP_SERVICE_LOG_LEVEL=INFO

PORT=8080
SSL_ENABLED=false

SSH_HOST=localhost
SSH_USERNAME=user
SSH_PASSWORD=pass
SSH_DESTINATION_FOLDER=/home/user/

ID_RSA=base64encodedid_rsa
ID_RSA_PUB=base64encodedid_rsa_pub

Install dependencies.

mvn -ntp dependency:go-offline

Build the UploadService.jar file.

mvn -ntp package

Start the UploadService.jar file.

java -jar target/UploadService.jar

Docker

To build the docker image for Upload Service, run the following command.

docker-compose build

Then to execute the docker container, run the following command.

docker-compose up -d

License

© Nicholas Adamou.

It is free software, and may be redistributed under the terms specified in the LICENSE file.

About

Java middleman for sending files via SFTP to another server.

Resources

License

Stars

Watchers

Forks