Class MCRUploadHelper

java.lang.Object
org.mycore.frontend.fileupload.MCRUploadHelper

public abstract class MCRUploadHelper extends Object
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 Details

    • FILE_NAME_PATTERN_PROPERTY

      public static final String FILE_NAME_PATTERN_PROPERTY
      See Also:
    • FILE_NAME_PATTERN

      public static final String FILE_NAME_PATTERN
    • FILE_NAME_PREDICATE

      public static final Predicate<String> FILE_NAME_PREDICATE
  • Constructor Details

    • MCRUploadHelper

      public MCRUploadHelper()
  • Method Details

    • checkPathName

      public static void checkPathName(String path, boolean checkFilePattern) throws MCRException
      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 name
      checkFilePattern - checks if the last path element matches the pattern defined in the property FILE_NAME_PATTERN_PROPERTY
      Throws:
      MCRException - if path contains reserved character
      See Also:
    • checkPathName

      public static void checkPathName(String path) throws MCRException
      see checkPathName(String, boolean) checkFilePattern=true
      Parameters:
      path -
      Throws:
      MCRException