public static <T extends HttpServletRequest> List<Path> listChunks(T request) {
        Path chunkDir = getChunkDir(request);
        if (!chunkDir.toFile().exists()) {
            return Collections.emptyList();
        }

        return listChunks(chunkDir);
    }
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