
Configuration file format
<configuration>
<logo>
<erase>xxx</erase>
<slot><number>
n
</number><width>WW</width><height>HH</height><data>
databytes
</data></slot>
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();
// new.
// 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((twoH bo 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((twoH bo twoHyphens).getBytes());
System.out.println("Data was written.");
outputStream.close();
inputStream.close();
}
Chapter 1. Introducing the 4610 Models 1NR, 1NA, and 1ND
17
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Содержание 1NA
Страница 2: ......
Страница 8: ...vi SureMark Hardware Service ...
Страница 10: ...viii SureMark Hardware Service ...
Страница 12: ...x SureMark Hardware Service ...
Страница 16: ...xiv SureMark Hardware Service ...
Страница 18: ...xvi SureMark Hardware Service ...
Страница 46: ...28 SureMark Hardware Service ...
Страница 56: ...38 SureMark Hardware Service ...
Страница 88: ...70 SureMark Hardware Service ...
Страница 90: ...Assembly 1 Models 1NR 1NA and 1ND 1 2 3 4 5 7 6 72 SureMark Hardware Service ...
Страница 92: ...Assembly 1 continued 74 SureMark Hardware Service ...
Страница 108: ...90 SureMark Hardware Service ...
Страница 109: ......
Страница 110: ...G362 0565 05 ...