code: private String validateFile(final MultipartFile file) {
          final String filename = StringUtils
                  .cleanPath(file.getOriginalFilename());
          if (file.isEmpty()) {
              throw new StorageException(
                      "Failed to store empty file " + filename);
          }
          if (filename.contains("..")) {
              // This is a security check
              throw new StorageException(
                      "Cannot store file with relative path outside current"
                      + " directory "
                      + filename);
          }
          return filename;
      }
docs: Extract the filename and validate it.
  
  @param file the input file
  @return the filename