mirror of
https://github.com/binlaab/nanofiles.git
synced 2026-07-01 16:47:30 +02:00
'jars'
This commit is contained in:
@@ -420,8 +420,17 @@ public class DirectoryConnector {
|
||||
long filesize = -1;
|
||||
String filehash = null;
|
||||
|
||||
FileInfo[] list = this.getFileList();
|
||||
FileInfo[] foundFile = FileInfo.lookupHashSubstring(list, hashSubstring);
|
||||
DirMessage requestDL = new DirMessage(DirMessageOps.OPERATION_REQUEST_DIRDL, hashSubstring);
|
||||
byte[] requestBytes = requestDL.toString().getBytes();
|
||||
byte[] response = sendAndReceiveDatagrams(requestBytes);
|
||||
|
||||
String respStr = new String(response, 0, response.length);
|
||||
DirMessage respDL = DirMessage.fromString(respStr);
|
||||
|
||||
fileData = java.util.Base64.getDecoder().decode(respDL.getFiledata());
|
||||
filename = respDL.getFilename();
|
||||
filesize = respDL.getFileSize();
|
||||
filehash = respDL.getHash();
|
||||
|
||||
// TODO: crear nuevo mensaje dirdl y requestdirdl
|
||||
// similar a un mensaje peerdl
|
||||
|
||||
Reference in New Issue
Block a user