diff --git a/.github/workflows/it.yml b/.github/workflows/it.yml index 50b64e966b..ff4fb4fb37 100644 --- a/.github/workflows/it.yml +++ b/.github/workflows/it.yml @@ -47,4 +47,4 @@ jobs: - name: Build run: mvn --batch-mode -DskipTests=true -Dmaven.javadoc.skip=true package - name: Test - run: mvn --batch-mode verify + run: mvn --batch-mode -P CI verify diff --git a/pom.xml b/pom.xml index c4f9c5f7ef..7fca7ec848 100644 --- a/pom.xml +++ b/pom.xml @@ -268,9 +268,9 @@ ${activemq.version} - net.sf.ehcache - ehcache-core - 2.6.11 + com.github.ben-manes.caffeine + caffeine + 3.1.8 @@ -989,12 +989,7 @@ - travis - - - env.TRAVIS - - + CI diff --git a/src/main/java/ru/org/linux/user/UserpicController.java b/src/main/java/ru/org/linux/user/UserpicController.java index 72fa222cd2..fb2a135850 100644 --- a/src/main/java/ru/org/linux/user/UserpicController.java +++ b/src/main/java/ru/org/linux/user/UserpicController.java @@ -95,7 +95,7 @@ public ModelAndView addPhoto(@RequestParam("file") MultipartFile file, HttpServl Path uploadedFile = Files.createTempFile("userpic-", ""); try { - file.transferTo(uploadedFile.toFile()); + file.transferTo(uploadedFile); ImageParam param = userService.checkUserPic(uploadedFile.toFile()); String extension = param.getExtension(); @@ -114,7 +114,7 @@ public ModelAndView addPhoto(@RequestParam("file") MultipartFile file, HttpServl userDao.setPhoto(currentUser, photoname); - logger.info("Установлена фотография пользователем " + currentUser.getNick()); + logger.info("Установлена фотография пользователем {}", currentUser.getNick()); UriComponents profileUri = UriComponentsBuilder .fromUri(PROFILE_URI_TEMPLATE.expand(currentUser.getNick())) diff --git a/src/main/resources/ehcache.xml b/src/main/resources/ehcache.xml deleted file mode 100644 index 6512212b7b..0000000000 --- a/src/main/resources/ehcache.xml +++ /dev/null @@ -1,939 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/scala/ru/org/linux/gallery/ImageService.scala b/src/main/scala/ru/org/linux/gallery/ImageService.scala index f028c9f4b1..24e88c06d8 100644 --- a/src/main/scala/ru/org/linux/gallery/ImageService.scala +++ b/src/main/scala/ru/org/linux/gallery/ImageService.scala @@ -155,8 +155,8 @@ class ImageService(imageDao: ImageDao, editHistoryDao: EditHistoryDao, if (multipartFile != null && !multipartFile.isEmpty) { val uploadedFile = File.createTempFile("lor-image-", "") - logger.debug("Transfering upload to: " + uploadedFile) - multipartFile.transferTo(uploadedFile) + logger.debug(s"Transferring upload to: $uploadedFile") + multipartFile.transferTo(uploadedFile.toPath) Some(uploadedFile) } else { diff --git a/src/main/webapp/WEB-INF/applicationContext.xml b/src/main/webapp/WEB-INF/applicationContext.xml index c8eda506d7..ec9f5a1084 100644 --- a/src/main/webapp/WEB-INF/applicationContext.xml +++ b/src/main/webapp/WEB-INF/applicationContext.xml @@ -1,6 +1,6 @@ - + - - - - - - - - - - diff --git a/src/main/webapp/WEB-INF/fn.tld b/src/main/webapp/WEB-INF/fn.tld deleted file mode 100644 index ddd290cd00..0000000000 --- a/src/main/webapp/WEB-INF/fn.tld +++ /dev/null @@ -1,222 +0,0 @@ - - - - - - - JSTL 1.1 functions library - JSTL functions - 1.1 - fn - http://java.sun.com/jsp/jstl/functions - - - - Tests if an input string contains the specified substring. - - contains - org.apache.taglibs.standard.functions.Functions - boolean contains(java.lang.String, java.lang.String) - - <c:if test="${fn:contains(name, searchString)}"> - - - - - - Tests if an input string contains the specified substring in a case insensitive way. - - containsIgnoreCase - org.apache.taglibs.standard.functions.Functions - boolean containsIgnoreCase(java.lang.String, java.lang.String) - - <c:if test="${fn:containsIgnoreCase(name, searchString)}"> - - - - - - Tests if an input string ends with the specified suffix. - - endsWith - org.apache.taglibs.standard.functions.Functions - boolean endsWith(java.lang.String, java.lang.String) - - <c:if test="${fn:endsWith(filename, ".txt")}"> - - - - - - Escapes characters that could be interpreted as XML markup. - - escapeXml - org.apache.taglibs.standard.functions.Functions - java.lang.String escapeXml(java.lang.String) - - ${fn:escapeXml(param:info)} - - - - - - Returns the index withing a string of the first occurrence of a specified substring. - - indexOf - org.apache.taglibs.standard.functions.Functions - int indexOf(java.lang.String, java.lang.String) - - ${fn:indexOf(name, "-")} - - - - - - Joins all elements of an array into a string. - - join - org.apache.taglibs.standard.functions.Functions - java.lang.String join(java.lang.String[], java.lang.String) - - ${fn:join(array, ";")} - - - - - - Returns the number of items in a collection, or the number of characters in a string. - - length - org.apache.taglibs.standard.functions.Functions - int length(java.lang.Object) - - You have ${fn:length(shoppingCart.products)} in your shopping cart. - - - - - - Returns a string resulting from replacing in an input string all occurrences - of a "before" string into an "after" substring. - - replace - org.apache.taglibs.standard.functions.Functions - java.lang.String replace(java.lang.String, java.lang.String, java.lang.String) - - ${fn:replace(text, "-", "•")} - - - - - - Splits a string into an array of substrings. - - split - org.apache.taglibs.standard.functions.Functions - java.lang.String[] split(java.lang.String, java.lang.String) - - ${fn:split(customerNames, ";")} - - - - - - Tests if an input string starts with the specified prefix. - - startsWith - org.apache.taglibs.standard.functions.Functions - boolean startsWith(java.lang.String, java.lang.String) - - <c:if test="${fn:startsWith(product.id, "100-")}"> - - - - - - Returns a subset of a string. - - substring - org.apache.taglibs.standard.functions.Functions - java.lang.String substring(java.lang.String, int, int) - - P.O. Box: ${fn:substring(zip, 6, -1)} - - - - - - Returns a subset of a string following a specific substring. - - substringAfter - org.apache.taglibs.standard.functions.Functions - java.lang.String substringAfter(java.lang.String, java.lang.String) - - P.O. Box: ${fn:substringAfter(zip, "-")} - - - - - - Returns a subset of a string before a specific substring. - - substringBefore - org.apache.taglibs.standard.functions.Functions - java.lang.String substringBefore(java.lang.String, java.lang.String) - - Zip (without P.O. Box): ${fn:substringBefore(zip, "-")} - - - - - - Converts all of the characters of a string to lower case. - - toLowerCase - org.apache.taglibs.standard.functions.Functions - java.lang.String toLowerCase(java.lang.String) - - Product name: ${fn.toLowerCase(product.name)} - - - - - - Converts all of the characters of a string to upper case. - - toUpperCase - org.apache.taglibs.standard.functions.Functions - java.lang.String toUpperCase(java.lang.String) - - Product name: ${fn.UpperCase(product.name)} - - - - - - Removes white spaces from both ends of a string. - - trim - org.apache.taglibs.standard.functions.Functions - java.lang.String trim(java.lang.String) - - Name: ${fn.trim(name)} - - - - diff --git a/src/main/webapp/WEB-INF/jsp/errors/code403.jsp b/src/main/webapp/WEB-INF/jsp/errors/code403.jsp index c39bc92c34..30ad755fdf 100644 --- a/src/main/webapp/WEB-INF/jsp/errors/code403.jsp +++ b/src/main/webapp/WEB-INF/jsp/errors/code403.jsp @@ -29,7 +29,7 @@ String message = exception==null ? "":(exception.getMessage()==null?"":exception.getMessage()); - logger.debug("Forbidden. {}: {} ({})", request.getAttribute("jakarta.servlet.error.request_uri"), + logger.debug("Forbidden. {}: {} ({})", request.getAttribute(RequestDispatcher.ERROR_REQUEST_URI), message, AuthUtil.getNick()); %> diff --git a/src/main/webapp/WEB-INF/springapp-servlet.xml b/src/main/webapp/WEB-INF/springapp-servlet.xml index 5653ca88ad..db6abb20d0 100644 --- a/src/main/webapp/WEB-INF/springapp-servlet.xml +++ b/src/main/webapp/WEB-INF/springapp-servlet.xml @@ -73,6 +73,8 @@ + + diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index c76c4804cd..61e6881013 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -18,8 +18,7 @@ xmlns="https://jakarta.ee/xml/ns/jakartaee" xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - metadata-complete="true" - > + metadata-complete="true"> linux.org.ru @@ -65,14 +64,6 @@ /ExceptionResolver - - http://java.sun.com/jsp/jstl/core - /WEB-INF/c.tld - - - http://java.sun.com/jsp/jstl/functions - /WEB-INF/fn.tld - *.jsp true diff --git a/src/test/scala/ru/org/linux/user/UserpicControllerWebTest.scala b/src/test/scala/ru/org/linux/user/UserpicControllerWebTest.scala index 2a79b9496b..7eb95a7621 100644 --- a/src/test/scala/ru/org/linux/user/UserpicControllerWebTest.scala +++ b/src/test/scala/ru/org/linux/user/UserpicControllerWebTest.scala @@ -1,5 +1,5 @@ /* - * Copyright 1998-2022 Linux.org.ru + * Copyright 1998-2024 Linux.org.ru * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -155,7 +155,7 @@ class UserpicControllerWebTest { val auth = WebHelper.doLogin("JB", "passwd") val cr = addPhoto("src/main/webapp/tango/img/android.png", auth) - assertEquals(cr.code, StatusCode.Found) + assertEquals(StatusCode.Found, cr.code) val redirect = cr.header(HeaderNames.Location).getOrElse("")