chunkproblem
This commit is contained in:
parent
2e55467ba1
commit
fe23c1a6af
@ -240,24 +240,9 @@ public class UDPHandler implements Runnable {
|
|||||||
data = parts[1];
|
data = parts[1];
|
||||||
|
|
||||||
if (data.charAt(data.length()) == '!') { // last chunk
|
if (data.charAt(data.length()) == '!') { // last chunk
|
||||||
// file zusammensetzen und im zielnode speichern
|
// store file in node
|
||||||
File file = new File("fileID");
|
//TODO: how to store chunks as FILE?
|
||||||
FileWriter fw;
|
node.storeFile(tempData);
|
||||||
try {
|
|
||||||
|
|
||||||
fw = new FileWriter(file);
|
|
||||||
for (int i = 0; i < tempData.length; i++) {
|
|
||||||
fw.write(tempData[i]);
|
|
||||||
}
|
|
||||||
fw.flush();
|
|
||||||
|
|
||||||
// store file in node
|
|
||||||
node.storeFile(file);
|
|
||||||
|
|
||||||
} catch (IOException e) {
|
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
tempData[chunkID] = data;
|
tempData[chunkID] = data;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user