no message

This commit is contained in:
2023-11-23 22:38:21 +03:00
parent b3401bfe1c
commit 509c858b1a
10 changed files with 89 additions and 173 deletions

View File

@@ -15,7 +15,6 @@ import com.sun.org.glassfish.gmbal.Description;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.nio.file.Paths;
public class Test extends riDBObject {
@Description("DEFAULT 1")
public int min_dim = 1; //мин размерность теста.
@@ -77,13 +76,16 @@ public class Test extends riDBObject {
return new File(Global.TempDirectory, temp_project_name);
}
//--
/*
public void packProject(db_project_info project) throws Exception {
//если берем из текущего проекта.
temp_project_name = Utils.getDateName("test");
//-
File tempProject = getTempProject();
File tempArchive = getTempArchive();
//-
FileUtils.forceMkdir(tempProject);
project.clearData();
project.Clone(tempProject, false);
//--
FileUtils.copyFile(project.db.getFile(),
@@ -93,6 +95,27 @@ public class Test extends riDBObject {
if (zip.Do(tempProject.getAbsolutePath(), tempArchive.getAbsolutePath())) {
project_archive_bytes = Utils.packFile(tempArchive);
} else throw new PassException("Не удалось создать архив проекта");
}
*/
public void packCode(File dir) throws Exception {
temp_project_name = Utils.getDateName("test");
//-
File tempProject = getTempProject();
File tempArchive = getTempArchive();
//- создать бд.
db_project_info project = new db_project_info(dir);
project.Open();
project.Close();
//-
project.clearData();
//-
FileUtils.forceMkdir(tempProject);
FileUtils.copyDirectory(dir, tempProject);
//--
ZipFolderPass zip = new ZipFolderPass();
if (zip.Do(tempProject.getAbsolutePath(), tempArchive.getAbsolutePath())) {
project_archive_bytes = Utils.packFile(tempArchive);
} else throw new PassException("Не удалось создать архив папки с кодом.");
}
public boolean unpackProjectOnServer() throws Exception {
File tmpArchive = new File(Global.TempDirectory, temp_project_name + ".zip");
@@ -125,4 +148,7 @@ public class Test extends riDBObject {
throw new RepositoryRefuseException("Не удалось переписать архив проекта");
return true;
}
public String getFilesForTable(){
return files.replace("\n", ";");
}
}

View File

@@ -39,7 +39,7 @@ public class TestDBTable extends iDBTable<Test> {
case 4:
return object.max_dim;
case 5:
return object.files;
return object.getFilesForTable();
default:
return null;
}