diff --git a/docs-web/pom.xml b/docs-web/pom.xml
index d8b9175c..86514de4 100644
--- a/docs-web/pom.xml
+++ b/docs-web/pom.xml
@@ -146,36 +146,11 @@
target/classes;../docs-core/target/classes
src/dev/main/webapp/web-override.xml
+ STOPKEY
+ 1099
-
-
- org.codehaus.cargo
- cargo-maven2-plugin
-
-
- jetty8x
- remote
-
-
-
- remote
-
-
-
-
- com.sismics.docs
- docs-web
- war
-
- /docs
-
- http://localhost:8080/docs/index.html
-
-
-
-
@@ -251,6 +226,8 @@
target/classes;../docs-core/target/classes
src/dev/main/webapp/web-override.xml
+ STOPKEY
+ 1099
diff --git a/docs-web/src/main/java/com/sismics/docs/rest/resource/AppResource.java b/docs-web/src/main/java/com/sismics/docs/rest/resource/AppResource.java
index 6d9d939c..5a2bdc7a 100644
--- a/docs-web/src/main/java/com/sismics/docs/rest/resource/AppResource.java
+++ b/docs-web/src/main/java/com/sismics/docs/rest/resource/AppResource.java
@@ -81,7 +81,7 @@ public class AppResource extends BaseResource {
* @param message Filter on message
* @param limit Page limit
* @param offset Page offset
- * @return
+ * @return Response
* @throws JSONException
*/
@GET
@@ -115,7 +115,7 @@ public class AppResource extends BaseResource {
PaginatedList paginatedList = PaginatedLists.create(limit, offset);
memoryAppender.find(logCriteria, paginatedList);
JSONObject response = new JSONObject();
- List logs = new ArrayList();
+ List logs = new ArrayList<>();
for (LogEntry logEntry : paginatedList.getResultList()) {
JSONObject log = new JSONObject();
log.put("date", logEntry.getTimestamp());
diff --git a/docs-web/src/main/java/com/sismics/docs/rest/resource/DocumentResource.java b/docs-web/src/main/java/com/sismics/docs/rest/resource/DocumentResource.java
index a6413223..5dcccb3a 100644
--- a/docs-web/src/main/java/com/sismics/docs/rest/resource/DocumentResource.java
+++ b/docs-web/src/main/java/com/sismics/docs/rest/resource/DocumentResource.java
@@ -65,7 +65,7 @@ public class DocumentResource extends BaseResource {
// Get tags
TagDao tagDao = new TagDao();
List tagDtoList = tagDao.getByDocumentId(id);
- List tags = new ArrayList();
+ List tags = new ArrayList<>();
for (TagDto tagDto : tagDtoList) {
JSONObject tag = new JSONObject();
tag.put("id", tagDto.getId());
@@ -107,7 +107,7 @@ public class DocumentResource extends BaseResource {
Date createDateMax = ValidationUtil.validateDate(createDateMaxStr, "create_date_max", true);
JSONObject response = new JSONObject();
- List documents = new ArrayList();
+ List documents = new ArrayList<>();
DocumentDao documentDao = new DocumentDao();
TagDao tagDao = new TagDao();
@@ -132,7 +132,7 @@ public class DocumentResource extends BaseResource {
// Get tags
List tagDtoList = tagDao.getByDocumentId(documentDto.getId());
- List tags = new ArrayList();
+ List tags = new ArrayList<>();
for (TagDto tagDto : tagDtoList) {
JSONObject tag = new JSONObject();
tag.put("id", tagDto.getId());
@@ -260,8 +260,8 @@ public class DocumentResource extends BaseResource {
private void updateTagList(String documentId, List tagList) throws JSONException {
if (tagList != null) {
TagDao tagDao = new TagDao();
- Set tagSet = new HashSet();
- Set tagIdSet = new HashSet();
+ Set tagSet = new HashSet<>();
+ Set tagIdSet = new HashSet<>();
List tagDbList = tagDao.getByUserId(principal.getId());
for (Tag tagDb : tagDbList) {
tagIdSet.add(tagDb.getId());
diff --git a/docs-web/src/main/java/com/sismics/docs/rest/resource/FileResource.java b/docs-web/src/main/java/com/sismics/docs/rest/resource/FileResource.java
index c7080e97..cc0c36bc 100644
--- a/docs-web/src/main/java/com/sismics/docs/rest/resource/FileResource.java
+++ b/docs-web/src/main/java/com/sismics/docs/rest/resource/FileResource.java
@@ -54,7 +54,7 @@ public class FileResource extends BaseResource {
}
FileDao fileDao = new FileDao();
- File fileDb = null;
+ File fileDb;
try {
fileDb = fileDao.getFile(id);
} catch (NoResultException e) {
@@ -73,7 +73,7 @@ public class FileResource extends BaseResource {
/**
* Add a file to a document.
*
- * @param id Document ID
+ * @param documentId Document ID
* @param fileBodyPart File to add
* @return Response
* @throws JSONException
@@ -94,7 +94,7 @@ public class FileResource extends BaseResource {
// Get the document
DocumentDao documentDao = new DocumentDao();
- Document document = null;
+ Document document;
try {
document = documentDao.getDocument(documentId, principal.getId());
} catch (NoResultException e) {
@@ -105,7 +105,7 @@ public class FileResource extends BaseResource {
// Validate mime type
InputStream is = new BufferedInputStream(fileBodyPart.getValueAs(InputStream.class));
- String mimeType = null;
+ String mimeType;
try {
mimeType = MimeTypeUtil.guessMimeType(is);
} catch (Exception e) {
@@ -145,8 +145,8 @@ public class FileResource extends BaseResource {
/**
* Reorder files.
*
- * @param id Document ID
- * @param order List of files ID in the new order
+ * @param documentId Document ID
+ * @param idList List of files ID in the new order
* @return Response
* @throws JSONException
*/
@@ -190,7 +190,7 @@ public class FileResource extends BaseResource {
/**
* Returns files linked to a document.
*
- * @param id Document ID
+ * @param documentId Document ID
* @return Response
* @throws JSONException
*/
@@ -207,7 +207,7 @@ public class FileResource extends BaseResource {
List fileList = fileDao.getByDocumentId(documentId);
JSONObject response = new JSONObject();
- List files = new ArrayList();
+ List files = new ArrayList<>();
for (File fileDb : fileList) {
JSONObject file = new JSONObject();
@@ -240,7 +240,7 @@ public class FileResource extends BaseResource {
// Get the file
FileDao fileDao = new FileDao();
- File file = null;
+ File file;
try {
file = fileDao.getFile(id);
} catch (NoResultException e) {
@@ -275,7 +275,7 @@ public class FileResource extends BaseResource {
// Get the file
FileDao fileDao = new FileDao();
- File file = null;
+ File file;
try {
file = fileDao.getFile(id);
} catch (NoResultException e) {
@@ -284,7 +284,7 @@ public class FileResource extends BaseResource {
// Get the stored file
- java.io.File storedfile = null;
+ java.io.File storedfile;
if (thumbnail) {
if (ImageUtil.isImage(file.getMimeType())) {
storedfile = Paths.get(DirectoryUtil.getStorageDirectory().getPath(), id + "_thumb").toFile();
diff --git a/docs-web/src/main/java/com/sismics/docs/rest/resource/LocaleResource.java b/docs-web/src/main/java/com/sismics/docs/rest/resource/LocaleResource.java
index df158548..ac2a1db7 100644
--- a/docs-web/src/main/java/com/sismics/docs/rest/resource/LocaleResource.java
+++ b/docs-web/src/main/java/com/sismics/docs/rest/resource/LocaleResource.java
@@ -32,7 +32,7 @@ public class LocaleResource extends BaseResource {
LocaleDao localeDao = new LocaleDao();
List localeList = localeDao.findAll();
JSONObject response = new JSONObject();
- List items = new ArrayList();
+ List items = new ArrayList<>();
for (Locale locale : localeList) {
JSONObject item = new JSONObject();
item.put("id", locale.getId());
diff --git a/docs-web/src/main/java/com/sismics/docs/rest/resource/TagResource.java b/docs-web/src/main/java/com/sismics/docs/rest/resource/TagResource.java
index 70eaee96..3f43e8fe 100644
--- a/docs-web/src/main/java/com/sismics/docs/rest/resource/TagResource.java
+++ b/docs-web/src/main/java/com/sismics/docs/rest/resource/TagResource.java
@@ -41,7 +41,7 @@ public class TagResource extends BaseResource {
TagDao tagDao = new TagDao();
List tagList = tagDao.getByUserId(principal.getId());
JSONObject response = new JSONObject();
- List items = new ArrayList();
+ List items = new ArrayList<>();
for (Tag tag : tagList) {
JSONObject item = new JSONObject();
item.put("id", tag.getId());
@@ -70,7 +70,7 @@ public class TagResource extends BaseResource {
TagDao tagDao = new TagDao();
List tagStatDtoList = tagDao.getStats(principal.getId());
JSONObject response = new JSONObject();
- List items = new ArrayList();
+ List items = new ArrayList<>();
for (TagStatDto tagStatDto : tagStatDtoList) {
JSONObject item = new JSONObject();
item.put("id", tagStatDto.getId());
@@ -167,7 +167,7 @@ public class TagResource extends BaseResource {
/**
* Delete a tag.
*
- * @param name Name
+ * @param tagId Tag ID
* @return Response
* @throws JSONException
*/
diff --git a/docs-web/src/main/java/com/sismics/docs/rest/resource/ThemeResource.java b/docs-web/src/main/java/com/sismics/docs/rest/resource/ThemeResource.java
index af163421..f52c7f17 100644
--- a/docs-web/src/main/java/com/sismics/docs/rest/resource/ThemeResource.java
+++ b/docs-web/src/main/java/com/sismics/docs/rest/resource/ThemeResource.java
@@ -31,7 +31,7 @@ public class ThemeResource extends BaseResource {
ThemeDao themeDao = new ThemeDao();
List themeList = themeDao.findAll();
JSONObject response = new JSONObject();
- List items = new ArrayList();
+ List items = new ArrayList<>();
for (String theme : themeList) {
JSONObject item = new JSONObject();
item.put("id", theme);
diff --git a/docs-web/src/main/java/com/sismics/docs/rest/resource/UserResource.java b/docs-web/src/main/java/com/sismics/docs/rest/resource/UserResource.java
index 6a5a7d3d..ccb6e401 100644
--- a/docs-web/src/main/java/com/sismics/docs/rest/resource/UserResource.java
+++ b/docs-web/src/main/java/com/sismics/docs/rest/resource/UserResource.java
@@ -109,10 +109,6 @@ public class UserResource extends BaseResource {
* @param email E-Mail
* @param themeId Theme
* @param localeId Locale ID
- * @param displayTitleWeb Display only article titles (web application).
- * @param displayTitleMobile Display only article titles (mobile application).
- * @param displayUnreadWeb Display only unread titles (web application).
- * @param displayUnreadMobile Display only unread titles (mobile application).
* @param firstConnection True if the user hasn't acknowledged the first connection wizard yet.
* @return Response
* @throws JSONException
@@ -156,7 +152,7 @@ public class UserResource extends BaseResource {
if (StringUtils.isNotBlank(password)) {
user.setPassword(password);
- user = userDao.updatePassword(user);
+ userDao.updatePassword(user);
}
// Always return "ok"
@@ -173,10 +169,6 @@ public class UserResource extends BaseResource {
* @param email E-Mail
* @param themeId Theme
* @param localeId Locale ID
- * @param displayTitleWeb Display only article titles (web application).
- * @param displayTitleMobile Display only article titles (mobile application).
- * @param displayUnreadWeb Display only unread titles (web application).
- * @param displayUnreadMobile Display only unread titles (mobile application).
* @return Response
* @throws JSONException
*/
@@ -224,7 +216,7 @@ public class UserResource extends BaseResource {
if (StringUtils.isNotBlank(password)) {
// Change the password
user.setPassword(password);
- user = userDao.updatePassword(user);
+ userDao.updatePassword(user);
}
// Always return "ok"
@@ -511,7 +503,7 @@ public class UserResource extends BaseResource {
checkBaseFunction(BaseFunction.ADMIN);
JSONObject response = new JSONObject();
- List users = new ArrayList();
+ List users = new ArrayList<>();
PaginatedList paginatedList = PaginatedLists.create(limit, offset);
SortCriteria sortCriteria = new SortCriteria(sortColumn, asc);
@@ -557,7 +549,7 @@ public class UserResource extends BaseResource {
}
JSONObject response = new JSONObject();
- List sessions = new ArrayList();
+ List sessions = new ArrayList<>();
AuthenticationTokenDao authenticationTokenDao = new AuthenticationTokenDao();