public final class SerialComYModem1K extends Object
Implements YMODEM-1K file transfer protocol state machine in Java.
| Constructor and Description |
|---|
SerialComYModem1K(SerialComManager scm,
long handle,
File[] filesToSend,
boolean textMode,
ISerialComYmodemProgress progressListener,
SerialComFTPCMDAbort transferState,
int osType)
Allocates a new SerialComYModem1K object with given details and associate it with the given
instance of SerialComManager class.
|
SerialComYModem1K(SerialComManager scm,
long handle,
File filesToReceive,
boolean textMode,
ISerialComYmodemProgress progressListener,
SerialComFTPCMDAbort transferState,
int osType)
Allocates a new SerialComYModem1K object with given details and associate it with the given
instance of SerialComManager class.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
receiveFileY()
Represents actions to execute in state machine to implement ymodem-1k protocol for
receiving files.
|
boolean |
sendFileY()
Represents actions to execute in state machine to implement ymodem-1k protocol
for sending files.
|
public SerialComYModem1K(SerialComManager scm, long handle, File[] filesToSend, boolean textMode, ISerialComYmodemProgress progressListener, SerialComFTPCMDAbort transferState, int osType)
Allocates a new SerialComYModem1K object with given details and associate it with the given instance of SerialComManager class. This is used for sending files.
scm - SerialComManager instance associated with this handle.handle - of the port on which file is to be communicated.filesToSend - all the files to be sent to the receiver end.textMode - if true file will be sent as text file (ASCII mode), if false file will be sent
as binary file.progressListener - object of class which implements ISerialComYmodemProgress interface and is
interested in knowing how many blocks have been sent/received till now.transferState - if application wish to abort sending/receiving file at instant of time due to
any reason, it can call abortTransfer method on this object. It can be null if application
does not wish to abort sending/receiving file explicitly.osType - operating system on which this application is running.public SerialComYModem1K(SerialComManager scm, long handle, File filesToReceive, boolean textMode, ISerialComYmodemProgress progressListener, SerialComFTPCMDAbort transferState, int osType)
Allocates a new SerialComYModem1K object with given details and associate it with the given instance of SerialComManager class. This is used for receiving files.
scm - SerialComManager instance associated with this handle.handle - of the port on which file is to be communicated.filesToReceive - folder in which all files received will be placed.textMode - if true file will be sent as text file (ASCII mode), if false file will be sent
as binary file.progressListener - object of class which implements ISerialComYmodemProgress interface and is
interested in knowing how many blocks have been sent/received till now.transferState - if application wish to abort sending/receiving file at instant of time due to
any reason, it can call abortTransfer method on this object. It can be null if application
does not wish to abort sending/receiving file explicitly.osType - operating system on which this application is running.public boolean sendFileY()
throws IOException
Represents actions to execute in state machine to implement ymodem-1k protocol for sending files.
SecurityException - if unable to read from file to be sent.IOException - if any I/O error occurs.com.serialpundit.core.SerialComException - if any I/0 error on serial port communication occurs.public boolean receiveFileY()
throws IOException
Represents actions to execute in state machine to implement ymodem-1k protocol for receiving files.
IOException - if any I/O error occurs.com.serialpundit.core.SerialComException - if any I/0 error on serial port communication occurs.Copyright © 2017. All rights reserved.