Package com.nomagic.magicdraw.esi.szip
Class ServerZipUtils
java.lang.Object
com.nomagic.magicdraw.esi.szip.ServerZipUtils
Utility class to work with server zip files.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidexportServerZip(Project project, boolean exportUsedProjects, Path path, ProgressStatus status) Exports project to the Server Zip file.Returns project IDs from the server zip file.static List<com.nomagic.magicdraw.esi.szip.ProjectInfo> Returns projects information contained in the server zip file.static List<ProjectDescriptor> importFromServerZip(Path file, Predicate<String> importProject, String categoryName) Imports projects from the server zip file to server.static voidupdateFromServerZip(Path file, Collection<ProjectDescriptor> descriptors) Updates projects from the server zip file.
-
Constructor Details
-
ServerZipUtils
public ServerZipUtils()
-
-
Method Details
-
exportServerZip
public static void exportServerZip(Project project, boolean exportUsedProjects, Path path, ProgressStatus status) throws Exception Exports project to the Server Zip file.- Parameters:
project- project to exportexportUsedProjects- to export with used projects -true, otherwise -falsepath- a path the projects will be exportedstatus- progress status- Throws:
com.nomagic.ci.persistence.PersistenceException- if persistence error occurs during the exportInterruptedException- if any thread has interrupted the current threadIllegalArgumentException- if the specified project is not TWC projectException
-
importFromServerZip
public static List<ProjectDescriptor> importFromServerZip(Path file, Predicate<String> importProject, @CheckForNull String categoryName) throws Exception Imports projects from the server zip file to server.- Parameters:
file- server zip fileimportProject- specific projects to import; to import all projects, set predicate to() -> true; in a multi-resource environment, it's only possible to import all projects at once -() -> truecategoryName- specific category name to import project; to import to 'Uncategorized' set -null; in a multi-resource environment, it's not possible to select category, set -null- Throws:
Exception- if any occurs
-
updateFromServerZip
public static void updateFromServerZip(Path file, Collection<ProjectDescriptor> descriptors) throws Exception Updates projects from the server zip file.- Parameters:
file- path to server zip filedescriptors- descriptors of project to update; in single-resource environment, allows to update one project (1 descriptor) including it's used projects. in multi-resource environment must pass all project descriptors.- Throws:
Exception- if any occurs
-
getProjectsInfosFromServerZip
public static List<com.nomagic.magicdraw.esi.szip.ProjectInfo> getProjectsInfosFromServerZip(Path file) throws Exception Returns projects information contained in the server zip file.- Parameters:
file- path to server zip file- Returns:
- list of projects information
- Throws:
Exception- if any occurs
-
getProjectIDsFromServerZip
Returns project IDs from the server zip file.- Parameters:
file- path to server zip file- Returns:
- list of project IDs
- Throws:
Exception- if any occurs
-