@Singleton
public class ImportExportService
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SESSION_UNZIPPED_STUDY_DIR |
Modifier and Type | Method and Description |
---|---|
void |
cleanupAfterStudyImport() |
java.io.File |
createStudyExportZipFile(Study study)
Zips a study.
|
com.fasterxml.jackson.databind.node.ObjectNode |
importStudy(User loggedInUser,
java.io.File file)
Import a uploaded study: there are 5 possible cases:
(udir - name of uploaded study asset dir, cdir - name of current study asset dir)
|
void |
importStudyConfirmed(User loggedInUser,
com.fasterxml.jackson.databind.JsonNode json) |
public static final java.lang.String SESSION_UNZIPPED_STUDY_DIR
public com.fasterxml.jackson.databind.node.ObjectNode importStudy(User loggedInUser, java.io.File file) throws java.io.IOException, ForbiddenException
1) study exists - udir exists - udir == cdir : ask confirmation to overwrite study and/or dir 2) study exists - udir exists - udir != cdir : ask confirmation to overwrite study and/or (dir && rename to cdir) 3) study exists - !udir exists : shouldn't happen, ask confirmation to overwrite study 4) !study exists - udir exists : ask to rename dir (generate new dir name) 5) !study exists - !udir exists : new study - write both
java.io.IOException
ForbiddenException
public void importStudyConfirmed(User loggedInUser, com.fasterxml.jackson.databind.JsonNode json) throws java.io.IOException, ForbiddenException, BadRequestException
java.io.IOException
ForbiddenException
BadRequestException
public void cleanupAfterStudyImport()
public java.io.File createStudyExportZipFile(Study study) throws java.io.IOException
java.io.IOException