TFTP client for vertx

vertx-tftp-client is a simple async tftp client which works with vert.x

License

License

Categories

Categories

CLI User Interface
GroupId

GroupId

io.github.onemancrew
ArtifactId

ArtifactId

vertx-tftp-client
Last Version

Last Version

1.0
Release Date

Release Date

Type

Type

jar
Description

Description

TFTP client for vertx
vertx-tftp-client is a simple async tftp client which works with vert.x
Project URL

Project URL

https://github.com/OneManCrew/vertx-tftp-client

Download vertx-tftp-client

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.onemancrew/vertx-tftp-client/ -->
<dependency>
    <groupId>io.github.onemancrew</groupId>
    <artifactId>vertx-tftp-client</artifactId>
    <version>1.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.onemancrew/vertx-tftp-client/
implementation 'io.github.onemancrew:vertx-tftp-client:1.0'
// https://jarcasting.com/artifacts/io.github.onemancrew/vertx-tftp-client/
implementation ("io.github.onemancrew:vertx-tftp-client:1.0")
'io.github.onemancrew:vertx-tftp-client:jar:1.0'
<dependency org="io.github.onemancrew" name="vertx-tftp-client" rev="1.0">
  <artifact name="vertx-tftp-client" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.onemancrew', module='vertx-tftp-client', version='1.0')
)
libraryDependencies += "io.github.onemancrew" % "vertx-tftp-client" % "1.0"
[io.github.onemancrew/vertx-tftp-client "1.0"]

Dependencies

compile (4)

Group / Artifact Type Version
io.vertx : vertx-core jar 3.6.1
io.vertx : vertx-codegen jar 3.6.1
org.slf4j : slf4j-api jar 1.7.21
ch.qos.logback : logback-classic jar 1.1.7

test (4)

Group / Artifact Type Version
io.vertx : vertx-core test-jar 3.6.1
io.vertx : vertx-unit jar 3.6.1
io.vertx : vertx-junit5 jar 3.6.1
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

Vert.x TFTP Client

License: MIT Maven Central Download

vertx-tftp-client is a simple async tftp client which works with vert.x v3.

The Following Java project implements the TFTP protocol and builds a TFTP client. Scope of the client is to upload and download files from a remote TFTP server. I have used Vert.x to implement this project as asynchronously.

To use this component, add the following dependency to the dependencies section of your build descriptor:

Maven (in your pom.xml):

<dependency>
  <groupId>io.github.onemancrew</groupId>
  <artifactId>vertx-tftp-client</artifactId>
  <version>1.0</version>
</dependency>

Gradle:

implementation 'io.github.onemancrew:vertx-tftp-client:1.0'

ivy:

<dependency org="io.github.onemancrew" name="vertx-tftp-client" rev="1.0">
	<artifact name="vertx-tftp-client" ext="pom"></artifact>
</dependency>

Creating TFTP Client

Vertx vertx = Vertx.vertx();
TftpClient client =new TftpClient(vertx,tftpServerIp,port);//default port 69

Upload files

client.upload("filePath",(progress)->{
    //progress will update every change in the upload progress.
    },
    (result)->{
    if (result.succeeded()) {
        System.out.println("upload succeeded");
      } else {
        System.out.println("error upload file" + result.cause().getMessage());
      }
});

Download file

client.download(fileName,downloadFoler,(result)->{
    (result)->{
        if (result.succeeded()) {
            System.out.println("download succeeded");
          } else {
            System.out.println("error download file" + result.cause().getMessage());
          }
});

Error Code Description

In case of TttpError Exception this id the description for each error code:

ErrorCode Description
1 File not found.
2 Access violation.
3 Disk full or allocation exceeded.
4 Illegal TFTP operation.
5 Unknown transfer ID.
6 File already exists.
7 No such user.

TFTP Upload Protocol:

Upload diagram

TFTP Download Protocol:

Download diagram

Versions

Version
1.0