This commit is contained in:
madwasp79 2019-02-08 14:16:56 +02:00
parent db45782b83
commit ef8fa866c1

View file

@ -1988,22 +1988,22 @@ public class OsmandAidlApi {
copyFilesCache.remove(key); copyFilesCache.remove(key);
fos.close(); fos.close();
file.renameTo(app.getAppPath(destination + filePart.getFilename())); file.renameTo(app.getAppPath(destination + filePart.getFilename()));
// file.delete();
return true; return true;
} else if (file.length() == filePart.getSentSize()) { } else if (file.length() == filePart.getSentSize()) {
fos.write(filePart.getFilePartData()); fos.write(filePart.getFilePartData());
return true; return true;
} }
return false; return false;
} else { } else {
// if (file.exists()) {
// file.delete();
// }
file.getParentFile().mkdirs(); file.getParentFile().mkdirs();
fos = new FileOutputStream(file, true); fos = new FileOutputStream(file, true);
fos.write(filePart.getFilePartData()); fos.write(filePart.getFilePartData());
copyFilesCache.put(key, fos); if (file.length()==filePart.getSize()) {
fos.close();
file.renameTo(app.getAppPath(destination + filePart.getFilename()));
} else {
copyFilesCache.put(key, fos);
}
return true; return true;
} }