net.digger:xymodem

Java implementation of XModem and YModem protocols, for downloading files.

License

License

Categories

Categories

Net
GroupId

GroupId

net.digger
ArtifactId

ArtifactId

xymodem
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

net.digger:xymodem
Java implementation of XModem and YModem protocols, for downloading files.
Project URL

Project URL

https://github.com/diggernet/XYModem
Source Code Management

Source Code Management

https://github.com/diggernet/XYModem/tree/develop

Download xymodem

How to add to project

<!-- https://jarcasting.com/artifacts/net.digger/xymodem/ -->
<dependency>
    <groupId>net.digger</groupId>
    <artifactId>xymodem</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/net.digger/xymodem/
implementation 'net.digger:xymodem:1.1.0'
// https://jarcasting.com/artifacts/net.digger/xymodem/
implementation ("net.digger:xymodem:1.1.0")
'net.digger:xymodem:jar:1.1.0'
<dependency org="net.digger" name="xymodem" rev="1.1.0">
  <artifact name="xymodem" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.digger', module='xymodem', version='1.1.0')
)
libraryDependencies += "net.digger" % "xymodem" % "1.1.0"
[net.digger/xymodem "1.1.0"]

Dependencies

compile (1)

Group / Artifact Type Version
net.digger : crc-util jar 1.0.0

Project Modules

There are no modules declared in this project.

XYModem

XYModem is a Java implementation of the XModem and YModem file download protocols. It supports:

  • XModem-Checksum
  • XModem-CRC
  • XModem-1K
  • YModem-Batch
  • YModem-G

It also implements just enough of ZModem for AutoDownload support, though that only works if the sending ZModem implemenation provides automatic fallback to XModem or YModem.

Maven configuration

	<dependency>
		<groupId>net.digger</groupId>
		<artifactId>xymodem</artifactId>
		<version>1.1.0</version>
	</dependency>

Usage

Create an implemenation of IOHandler, to provide I/O methods appropriate for your environment.

Create a new instance of XYModem, giving it an instance of your IOHandler implementation.

	XYModem xymodem = new XYModem(ioHandler);

After the sender has been instructed to begin an XModem or YModem download, pass control to XYModem.

	xymodem.download();

XYModem will handle the handshaking and download process, using IOHandler.read(timeout) to read bytes from the sender and IOHandler.write(ch) to write bytes to the sender.

Each time a file download is complete, it will call IOHandler.received(download) to pass details of the downloaded file. This may be called more than once for a batch download (YModem-Batch or YModem-G).

When the download session is complete, XYModem.download() will return.

During the download process, IOHandler.log(message) and IOHandler.progress(bytes, total) will be called with messages and download progress.

Before beginning a download, you can call xymodem.setOverrunOption() to set the desired behavior if a file received via the YModem protocol exceeds the size claimed by the sender.

AutoDownload

Before a download has been initiated, incoming bytes can be checked for a ZModem download signature.

	xymodem.autoDownloadDetect(ch);

This method will return true if a ZModem ZRQINIT header is detected, indicating the sender is ready to begin download. It can be used to automatically initiate a download:

	if (xymodem.autoDownloadDetect(ch)) {
		xymodem.download();
	}

Please note: If the sending ZModem implementation does not support automatic fallback to XModem or YModem, the handshaking will time out and download() will return, with the sender still waiting for a ZModem download to begin.

Dependencies

License

XYModem is provided under the terms of the GNU LGPLv3.

Versions

Version
1.1.0
1.0.0