public static <T extends HttpServletRequest> Path getChunkDir(T request) {
        FileUploadChunkDecoder<T> chunkDecoder = getFileUploadChunkDecoder(request);
        String fileKey = chunkDecoder.generateFileInfoKey(request);
        return Paths.get(chunkDecoder.getUploadDirectory(request), fileKey);
    }
Converts a JavaScript regular expression like '/(\.|\/)(gif|jpeg|jpg|png)$/i'
to the Java usable format '(\\.|\\/)(gif|jpeg|jpg|png)$'
@param jsRegex the client side JavaScript regex
@return the Java converted version of the regex
primefaces/src/main/java/org/primefaces/util/FileUploadUtils.java