From d4d19a82681e26ee7ddf19e02a21019e81de409f Mon Sep 17 00:00:00 2001 From: Bojnourdi Date: Sun, 23 Aug 2015 23:52:14 +0200 Subject: [PATCH] FileDaoClient commit --- .../src/com/edf/gde/dao/FileDaoClient.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/projects/GDE-test/src/com/edf/gde/dao/FileDaoClient.java b/projects/GDE-test/src/com/edf/gde/dao/FileDaoClient.java index f27ebd6..85b61db 100644 --- a/projects/GDE-test/src/com/edf/gde/dao/FileDaoClient.java +++ b/projects/GDE-test/src/com/edf/gde/dao/FileDaoClient.java @@ -3,6 +3,7 @@ */ package com.edf.gde.dao; +import com.edf.gde.transferables.ChunkTO; import com.edf.gde.transferables.CommandTO; import com.edf.gde.transferables.FileTO; import java.io.IOException; @@ -49,5 +50,28 @@ public class FileDaoClient extends BaseDao { commandTO.setData(toJson(fileTO)); return postCommand(commandTO, fileTO, FileTO.class); } + + public FileTO readFile(long fileId) throws IOException { + CommandTO commandTO = createCommand(READFILE); + commandTO.setLong("fileId", fileId); + return postCommand(commandTO, null, FileTO.class); + } + + public FileTO findFileByName(String name) throws IOException { + CommandTO commandTO = createCommand(FINDBYNAME); + commandTO.setString("fileName", name); + return postCommand(commandTO, null, FileTO.class); + } + + public void createChunk(ChunkTO chunkTO) throws IOException { + CommandTO commandTO = createCommand(CREATECHUNK); + postCommand(commandTO, chunkTO); + } + + public ChunkTO readChunk(long chunkId) throws IOException { + CommandTO commandTO = createCommand(READCHUNK); + commandTO.setLong("chunkId", chunkId); + return postCommand(commandTO, null, ChunkTO.class); + } } -- 2.39.2