Package org.mycore.sword
Class MCRSwordUtil
java.lang.Object
org.mycore.sword.MCRSwordUtil
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static interface
static class
static class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addDatesToEntry
(org.apache.abdera.model.Entry entry, MCRObject mcrObject) static org.swordapp.server.DepositReceipt
buildDepositReceipt
(org.apache.abdera.i18n.iri.IRI iri) static MCRDerivate
createDerivate
(String documentID) static Path
createTempFileFromStream
(String fileName, InputStream inputStream, String checkMd5) Stores stream to temp file and checks md5static String
decodeURLPart
(String uri) static String
encodeURLPart
(String uri) static void
extractZipToPath
(Path zipFilePath, MCRPath target) static String
getFilename
(Path path) static MCRObject
getMcrObjectForDerivateID
(String requestDerivateID) static org.swordapp.server.MediaResource
getZippedDerivateMediaResource
(String object) static List<MCRSwordUtil.MCRValidationResult>
validateZipFile
(MCRSwordUtil.MCRFileValidator validator, Path zipFile)
-
Constructor Details
-
MCRSwordUtil
public MCRSwordUtil()
-
-
Method Details
-
createDerivate
public static MCRDerivate createDerivate(String documentID) throws MCRPersistenceException, IOException, MCRAccessException -
getZippedDerivateMediaResource
-
getFilename
-
createTempFileFromStream
public static Path createTempFileFromStream(String fileName, InputStream inputStream, String checkMd5) throws IOException Stores stream to temp file and checks md5- Parameters:
inputStream
- the stream which holds the FilecheckMd5
- the md5 to compare with (or null if no md5 check is needed)- Returns:
- the path to the temp file
- Throws:
IOException
- if md5 does mismatch or if stream could not be read
-
extractZipToPath
public static void extractZipToPath(Path zipFilePath, MCRPath target) throws org.swordapp.server.SwordError, IOException, NoSuchAlgorithmException, URISyntaxException - Throws:
org.swordapp.server.SwordError
IOException
NoSuchAlgorithmException
URISyntaxException
-
validateZipFile
public static List<MCRSwordUtil.MCRValidationResult> validateZipFile(MCRSwordUtil.MCRFileValidator validator, Path zipFile) throws IOException, URISyntaxException - Throws:
IOException
URISyntaxException
-
encodeURLPart
-
decodeURLPart
-
buildDepositReceipt
public static org.swordapp.server.DepositReceipt buildDepositReceipt(org.apache.abdera.i18n.iri.IRI iri) throws org.swordapp.server.SwordError - Throws:
org.swordapp.server.SwordError
-
addDatesToEntry
-
getMcrObjectForDerivateID
-