@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)
Returns a JATOS study archive (suffix .jzip).
|
com.fasterxml.jackson.databind.node.ObjectNode |
importStudy(User signedinUser,
java.io.File file)
Import a uploaded JATOS study archive (.jzip file)
There are 5 possible cases:
(udir - name of uploaded study asset dir, cdir - name of current study asset dir)
|
java.lang.Long |
importStudyConfirmed(User signedinUser,
boolean keepProperties,
boolean keepAssets,
boolean keepCurrentAssetsName,
boolean renameAssets) |
public static final java.lang.String SESSION_UNZIPPED_STUDY_DIR
public com.fasterxml.jackson.databind.node.ObjectNode importStudy(User signedinUser, 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 java.lang.Long importStudyConfirmed(User signedinUser, boolean keepProperties, boolean keepAssets, boolean keepCurrentAssetsName, boolean renameAssets) throws java.io.IOException, ForbiddenException, NotFoundException
java.io.IOException
ForbiddenException
NotFoundException
public void cleanupAfterStudyImport()
public java.io.File createStudyExportZipFile(Study study) throws java.io.IOException
java.io.IOException