Class ServerZipUtils

java.lang.Object
com.nomagic.magicdraw.esi.szip.ServerZipUtils

@OpenApiAll public class ServerZipUtils extends Object
Utility class to work with server zip files.
  • 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 export
      exportUsedProjects - to export with used projects - true, otherwise - false
      path - a path the projects will be exported
      status - progress status
      Throws:
      com.nomagic.ci.persistence.PersistenceException - if persistence error occurs during the export
      InterruptedException - if any thread has interrupted the current thread
      IllegalArgumentException - if the specified project is not TWC project
      Exception
    • 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 file
      importProject - 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 - () -> true
      categoryName - 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 file
      descriptors - 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

      public static List<String> getProjectIDsFromServerZip(Path file) throws Exception
      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