Package org.mycore.frontend.fileupload
Class MCRUploadHelper
java.lang.Object
org.mycore.frontend.fileupload.MCRUploadHelper
Common helper class for all services handling file upload.
- Version:
- $Revision: 34120 $ $Date: 2015-12-02 23:16:17 +0100 (Mi, 02 Dez 2015) $
- Author:
- Frank Lützenkirchen
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkPathName
(String path) seecheckPathName(String, boolean)
checkFilePattern=truestatic void
checkPathName
(String path, boolean checkFilePattern) checks if path contains reserved URI characters or path starts or ends with whitespace.
-
Field Details
-
FILE_NAME_PATTERN_PROPERTY
- See Also:
-
FILE_NAME_PATTERN
-
FILE_NAME_PREDICATE
-
-
Constructor Details
-
MCRUploadHelper
public MCRUploadHelper()
-
-
Method Details
-
checkPathName
checks if path contains reserved URI characters or path starts or ends with whitespace. There are some characters that are maybe allowed in file names but are reserved in URIs.- Parameters:
path
- complete path namecheckFilePattern
- checks if the last path element matches the pattern defined in the propertyFILE_NAME_PATTERN_PROPERTY
- Throws:
MCRException
- if path contains reserved character- See Also:
-
checkPathName
seecheckPathName(String, boolean)
checkFilePattern=true- Parameters:
path
-- Throws:
MCRException
-