no message

This commit is contained in:
2024-10-11 00:00:30 +03:00
parent a11b7711f7
commit f317ab1aa1
341 changed files with 1866 additions and 1688 deletions

View File

@@ -1,5 +1,5 @@
package _VisualDVM.Repository;
import Common.Utils.CommonUtils;
import Common.Utils.Utils_;
import _VisualDVM.Constants;
import Common.Database.Objects.DBObject;
import Common.Database.Database;
@@ -74,7 +74,7 @@ public abstract class RepositoryServer<D extends Database> {
if (printOn) {
try {
Log = new FileWriter("Log.txt", true);
String dmessage = CommonUtils.Brackets("SESSION -> ") + new Date() +
String dmessage = Utils_.Brackets("SESSION -> ") + new Date() +
" " + message;
Log.write(dmessage + "\n");
Log.close();
@@ -102,7 +102,7 @@ public abstract class RepositoryServer<D extends Database> {
LinkedHashMap<String, File> innerFiles = new LinkedHashMap<>();
for (String aName : message_in.files.keySet()) {
File f = Utils.getTempFileName(aName);
CommonUtils.bytesToFile(message_in.files.get(aName), f);
Utils_.bytesToFile(message_in.files.get(aName), f);
innerFiles.put(aName, f);
}
Vector<String> targets_ = new Vector<>(message_in.targets);
@@ -151,9 +151,9 @@ public abstract class RepositoryServer<D extends Database> {
Transport.send(message);
done = true;
} catch (Exception ex) {
System.out.println("Исключение во время отправки сообщения абоненту " + CommonUtils.Brackets(target));
System.out.println("Исключение во время отправки сообщения абоненту " + Utils_.Brackets(target));
ex.printStackTrace();
CommonUtils.sleep(1000);
Utils_.sleep(1000);
} finally {
attempts--;
}
@@ -210,20 +210,20 @@ public abstract class RepositoryServer<D extends Database> {
switch (code) {
//<editor-fold desc="файлы и почта">
case ReadFile:
Print("Отправить клиенту текст файла по пути " + CommonUtils.Brackets(request.arg));
Print("Отправить клиенту текст файла по пути " + Utils_.Brackets(request.arg));
response = new ServerExchangeUnit_2021(ServerCode.OK, "", Utils.ReadAllText(new File(request.arg)));
break;
case SendFile:
//нам пришел файл.
Print("Получить от клиента файл, и распаковать его по пути " + CommonUtils.Brackets(request.arg));
Print("Получить от клиента файл, и распаковать его по пути " + Utils_.Brackets(request.arg));
request.Unpack(); //распаковка идет по его аргу-пути назначения
response = new ServerExchangeUnit_2021(ServerCode.OK);
break;
case ReceiveFile:
Print("Отправить клиенту файл по пути " + CommonUtils.Brackets(request.arg));
Print("Отправить клиенту файл по пути " + Utils_.Brackets(request.arg));
response = new ServerExchangeUnit_2021(ServerCode.OK);
File file = new File(request.arg);
response.object = file.exists() ? CommonUtils.fileToBytes(file) : null;
response.object = file.exists() ? Utils_.fileToBytes(file) : null;
break;
case Email:
Print("Отправка сообщения электронной почты");