Configuration File Format - Toshiba 1NR Hardware Service Manual

Single-station printer
Table of Contents

Advertisement

|
public static void main(String[] args) throws IOException {
|
// takes file path from first program's argument
|
String filePath = "C:\\ec12_0a.hex";
|
File uploadFile = new File(filePath);
|
|
System.out.println("File to upload: " + filePath);
|
|
// creates a HTTP connection
|
URL url = new URL(UPLOAD_URL);
|
HttpURLConnection httpConn = (HttpURLConnection) url.openConnection();
|
httpConn.setUseCaches(false);
|
httpConn.setDoOutput(true);
|
httpConn.setRequestMethod("POST");
|
httpConn.setRequestProperty("Content-type","multipart/form-data; boundary=" + boundary);
|
|
// sets file name as a HTTP header
|
httpConn.setRequestProperty("fileName", uploadFile.getName());
|
httpConn.connect();
|
// opens output stream of the HTTP connection for writing data
|
OutputStream outputStream = httpConn.getOutputStream();
|
|
// Opens input stream of the file for reading data
|
FileInputStream inputStream = new FileInputStream(uploadFile);
|
|
byte[] buffer = new byte[BUFFER_SIZE];
|
int bytesRead = -1;
|
|
System.out.println("Start writing data...");
|
|
outputStream.write((twoHyphens + boundary + crlf).getBytes("UTF8"));
|
outputStream.write(new String("Content-Disposition: form-data; name=\"" +
|
uploadFile.getName() + "\";filename=\"" + "textFile" + "\"" + crlf).getBytes("UTF8"));
|
outputStream.write(new String("Content-Type: application/octet-stream\r\n\r\n").
|
getBytes("UTF8"));
|
|
while ((bytesRead = inputStream.read(buffer)) != -1) {
|
outputStream.write(buffer, 0, bytesRead);
|
}
|
outputStream.write(crlf.getBytes());
|
outputStream.write((twoHyphens + boundary + twoHyphens).getBytes());
|
|
System.out.println("Data was written.");
|
outputStream.close();
|
inputStream.close();
|
|
}
|

Configuration file format

|
|
|
|
|
|
// new.
<configuration>
<logo>
<erase>xxx</erase>
<slot><number>n</number><width>WW</width><height>HH</height><data>
databytes</data></slot>
Chapter 1. Introducing the 4610 Models 1NR, 1NA, and 1ND
17

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

1nd1na

Table of Contents