рефакторинг

This commit is contained in:
2025-02-18 16:21:20 +03:00
parent 9c0ed53d52
commit 0a123988b3
163 changed files with 938 additions and 367 deletions

View File

@@ -0,0 +1,57 @@
package _VisualDVM.ComponentsServer.Component;
import Common.Utils.Utils_;
import _VisualDVM.Utils;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Locale;
public class Instruction extends Component {
@Override
public String getFileName() {
return "Instruction.pdf";
}
@Override
public String getNewFileName() {
return "Instruction_new.pdf";
}
@Override
public boolean isNecessary() {
return false;
}
@Override
public ComponentType getComponentType() {
return ComponentType.Instruction;
}
public void Update() throws Exception {
ReplaceOldFile();
GetVersionInfo();
actual_version = 1;
}
@Override
public String getVersionText() {
return code;
}
//вызывается в первую очередь
@Override
public void unpackActualVersion(String v_string) {
actual_code = v_string;
actual_version = code.isEmpty() ? 1 : ((code.equals(actual_code)) ? 1 : 2);
if (CanBeUpdated())
CheckIfNeedsUpdateOrPublish();
}
@Override
public void unpackMinimalVersion(String v_string) {
//--
}
@Override
public void GetVersionInfo() {
try {
version = 1;
code = Utils.md5Custom(Utils.ReadAllText(getFile()));
DateFormat df = new SimpleDateFormat("MMM dd yyyy HH:mm:ss", Locale.ENGLISH);
date_text = df.format(getFile().lastModified());
} catch (Exception e) {
Utils_.MainLog.PrintException(e);
}
}
}