private void deleteChunk(Task task) { List<Chunk> TaskChunks = chunksDataSource.chunksRelatedTask(task.id); for (Chunk chunk : TaskChunks) { FileUtils.delete(task.save_address, String.valueOf(chunk.id)); chunksDataSource.delete(chunk.id); } }
private void makeFileForChunks(int firstId, Task task) { for (int endId = firstId + task.chunks; firstId < endId; firstId++) FileUtils.create(task.save_address, String.valueOf(firstId)); }