no message
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
package Repository;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common_old.Constants;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Database;
|
||||
@@ -73,7 +74,7 @@ public abstract class RepositoryServer<D extends Database> {
|
||||
if (printOn) {
|
||||
try {
|
||||
Log = new FileWriter("Log.txt", true);
|
||||
String dmessage = Utils.Brackets("SESSION -> ") + new Date() +
|
||||
String dmessage = CommonUtils.Brackets("SESSION -> ") + new Date() +
|
||||
" " + message;
|
||||
Log.write(dmessage + "\n");
|
||||
Log.close();
|
||||
@@ -150,7 +151,7 @@ public abstract class RepositoryServer<D extends Database> {
|
||||
Transport.send(message);
|
||||
done = true;
|
||||
} catch (Exception ex) {
|
||||
System.out.println("Исключение во время отправки сообщения абоненту " + Utils.Brackets(target));
|
||||
System.out.println("Исключение во время отправки сообщения абоненту " + CommonUtils.Brackets(target));
|
||||
ex.printStackTrace();
|
||||
Utils.sleep(1000);
|
||||
} finally {
|
||||
@@ -209,17 +210,17 @@ public abstract class RepositoryServer<D extends Database> {
|
||||
switch (code) {
|
||||
//<editor-fold desc="файлы и почта">
|
||||
case ReadFile:
|
||||
Print("Отправить клиенту текст файла по пути " + Utils.Brackets(request.arg));
|
||||
Print("Отправить клиенту текст файла по пути " + CommonUtils.Brackets(request.arg));
|
||||
response = new ServerExchangeUnit_2021(ServerCode.OK, "", Utils.ReadAllText(new File(request.arg)));
|
||||
break;
|
||||
case SendFile:
|
||||
//нам пришел файл.
|
||||
Print("Получить от клиента файл, и распаковать его по пути " + Utils.Brackets(request.arg));
|
||||
Print("Получить от клиента файл, и распаковать его по пути " + CommonUtils.Brackets(request.arg));
|
||||
request.Unpack(); //распаковка идет по его аргу-пути назначения
|
||||
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
||||
break;
|
||||
case ReceiveFile:
|
||||
Print("Отправить клиенту файл по пути " + Utils.Brackets(request.arg));
|
||||
Print("Отправить клиенту файл по пути " + CommonUtils.Brackets(request.arg));
|
||||
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
||||
File file = new File(request.arg);
|
||||
response.object = file.exists() ? Utils.packFile(file) : null;
|
||||
|
||||
Reference in New Issue
Block a user