In real work, many times we wanna use a constant variable or set config in specific tasks for sharing variables in the whole project. Let’s see how can we set it.

Image for post
Image for post
Configuration reference

Create a java class

In the example, we create the class name Config to keep the init config of our project. We can create a java class with the following content:

package th.co.singh.config;

import io.quarkus.arc.config.ConfigProperties;
import io.quarkus.runtime.annotations.ConfigItem;

@ConfigProperties(prefix = "config") // set prefix name here
public class Config {
@ConfigItem(
name = "server-address", // set item name here
defaultValue = "12.111.11.111" …

Image for post
Image for post

In this tutorial we’ll discuss how to download and upload files from a remote server using SFTP in Quarkus.

we’ll use two different libraries: JSch and Quarkus JSch.

  1. Using JSch

First, let’s see how to download and upload files from a remote server using the JSch library.

1.1 Maven Configuration

We’ll need to add the jsch dependency to our pom.xml. The latest version of jsch can be found on Maven Central.

<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.55</version>
</dependency>

1.2 Add — initialize-at-run-time to application.properties

When using JSch library we’ll need to add a class com.jcraft.jsch to initialize at run time. If we’ll…

Lionel P. Albus

Full-Stack Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store