chunkproblem

This commit is contained in:
Michael Scholz 2013-02-10 19:18:52 +01:00
parent 2e55467ba1
commit fe23c1a6af

View File

@ -240,24 +240,9 @@ public class UDPHandler implements Runnable {
data = parts[1];
if (data.charAt(data.length()) == '!') { // last chunk
// file zusammensetzen und im zielnode speichern
File file = new File("fileID");
FileWriter fw;
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();
}
// store file in node
//TODO: how to store chunks as FILE?
node.storeFile(tempData);
} else {
tempData[chunkID] = data;