Class FileNameValidator


  • @AlfrescoPublicApi
    public class FileNameValidator
    extends java.lang.Object
    Static checker for valid file names.
    Author:
    Derek Hulley
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String FILENAME_ILLEGAL_REGEX
      The bad file name pattern.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getValidFileName​(java.lang.String fileName)
      Replaces illegal filename characters with '_'
      static boolean isValid​(java.lang.String name)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • FILENAME_ILLEGAL_REGEX

        public static final java.lang.String FILENAME_ILLEGAL_REGEX
        The bad file name pattern.
        See Also:
        Constant Field Values
    • Constructor Detail

      • FileNameValidator

        public FileNameValidator()
    • Method Detail

      • isValid

        public static boolean isValid​(java.lang.String name)
      • getValidFileName

        public static java.lang.String getValidFileName​(java.lang.String fileName)
        Replaces illegal filename characters with '_'