public class StreamingMultipartRequestResolver
extends org.dataone.mimemultipart.MultipartRequestResolver
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SYSMETA |
Constructor and Description |
---|
StreamingMultipartRequestResolver(java.lang.String tmpUploadDir,
int maxUploadSize)
Constructor
|
Modifier and Type | Method and Description |
---|---|
static void |
deleteTempFile(java.io.File temp)
Delete a temp file either immediately or on program exists according to the configuration
|
org.dataone.service.types.v1.SystemMetadata |
getSystemMetadataPart()
Get the system metadata object which was extracted from the sysmeta part.
|
org.dataone.mimemultipart.MultipartRequest |
resolveMultipart(javax.servlet.http.HttpServletRequest request) |
static CheckedFile |
writeStreamToCheckedFile(java.io.File file,
java.io.InputStream dataStream,
java.lang.String checksumAlgorithm,
java.lang.String pid)
Write the input stream into the given fileName and directory while calculate the checksum.
|
public static final java.lang.String SYSMETA
public StreamingMultipartRequestResolver(java.lang.String tmpUploadDir, int maxUploadSize)
tmpUploadDir
- the directory will temporarily host the stored files from the file parts in the http multiparts request.maxUploadSize
- the threshold size of files which can be allowed to uploadpublic org.dataone.mimemultipart.MultipartRequest resolveMultipart(javax.servlet.http.HttpServletRequest request) throws java.io.IOException, org.apache.commons.fileupload.FileUploadException, java.lang.InstantiationException, java.lang.IllegalAccessException, org.dataone.exceptions.MarshallingException, java.security.NoSuchAlgorithmException
resolveMultipart
in class org.dataone.mimemultipart.MultipartRequestResolver
java.io.IOException
org.apache.commons.fileupload.FileUploadException
java.lang.InstantiationException
java.lang.IllegalAccessException
org.dataone.exceptions.MarshallingException
java.security.NoSuchAlgorithmException
public static CheckedFile writeStreamToCheckedFile(java.io.File file, java.io.InputStream dataStream, java.lang.String checksumAlgorithm, java.lang.String pid) throws java.security.NoSuchAlgorithmException, java.io.FileNotFoundException, java.io.IOException
file
- the file into which the stream will be written. It should exists already.dataStream
- the source streamchecksumAlgorithm
- the algorithm will be used for calculating the checksumpid
- the pid of the object (only used for debug information)java.security.NoSuchAlgorithmException
java.io.FileNotFoundException
java.io.IOException
public org.dataone.service.types.v1.SystemMetadata getSystemMetadataPart()
public static void deleteTempFile(java.io.File temp)
temp
- the file will be deletedCopyright © 2023 Regents of the University of California. All Rights Reserved.