diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml
index 1129f001..9178b389 100644
--- a/.idea/codeStyleSettings.xml
+++ b/.idea/codeStyleSettings.xml
@@ -2,7 +2,11 @@
diff --git a/.idea/misc.xml b/.idea/misc.xml
index acdd00f4..816abb33 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -10,6 +10,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs-core/src/main/java/com/sismics/docs/core/dao/file/theme/ThemeDao.java b/docs-core/src/main/java/com/sismics/docs/core/dao/file/theme/ThemeDao.java
index 85a158cc..c82989d6 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/dao/file/theme/ThemeDao.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/dao/file/theme/ThemeDao.java
@@ -1,13 +1,13 @@
package com.sismics.docs.core.dao.file.theme;
+import com.google.common.collect.Lists;
+import com.sismics.docs.core.util.DirectoryUtil;
+
import java.io.File;
import java.io.FilenameFilter;
import java.util.ArrayList;
import java.util.List;
-import com.google.common.collect.Lists;
-import com.sismics.docs.core.util.DirectoryUtil;
-
/**
* Theme DAO.
*
diff --git a/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/AuthenticationTokenDao.java b/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/AuthenticationTokenDao.java
index e0cac1b9..39e7d571 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/AuthenticationTokenDao.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/AuthenticationTokenDao.java
@@ -1,16 +1,14 @@
package com.sismics.docs.core.dao.jpa;
-import java.util.Date;
-import java.util.List;
-import java.util.UUID;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-
-import org.joda.time.DateTime;
-
import com.sismics.docs.core.model.jpa.AuthenticationToken;
import com.sismics.util.context.ThreadLocalContext;
+import org.joda.time.DateTime;
+
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+import java.util.Date;
+import java.util.List;
+import java.util.UUID;
/**
* Authentication token DAO.
diff --git a/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/ConfigDao.java b/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/ConfigDao.java
index 9f8013ca..50bbc203 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/ConfigDao.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/ConfigDao.java
@@ -1,12 +1,12 @@
package com.sismics.docs.core.dao.jpa;
-import javax.persistence.EntityManager;
-import javax.persistence.NoResultException;
-
import com.sismics.docs.core.constant.ConfigType;
import com.sismics.docs.core.model.jpa.Config;
import com.sismics.util.context.ThreadLocalContext;
+import javax.persistence.EntityManager;
+import javax.persistence.NoResultException;
+
/**
* Configuration parameter DAO.
*
diff --git a/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/DocumentDao.java b/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/DocumentDao.java
index 266f196e..99fe3595 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/DocumentDao.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/DocumentDao.java
@@ -1,17 +1,5 @@
package com.sismics.docs.core.dao.jpa;
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import javax.persistence.EntityManager;
-import javax.persistence.NoResultException;
-import javax.persistence.Query;
-
import com.google.common.base.Joiner;
import com.sismics.docs.core.dao.jpa.criteria.DocumentCriteria;
import com.sismics.docs.core.dao.jpa.dto.DocumentDto;
@@ -22,6 +10,12 @@ import com.sismics.docs.core.util.jpa.QueryParam;
import com.sismics.docs.core.util.jpa.SortCriteria;
import com.sismics.util.context.ThreadLocalContext;
+import javax.persistence.EntityManager;
+import javax.persistence.NoResultException;
+import javax.persistence.Query;
+import java.sql.Timestamp;
+import java.util.*;
+
/**
* Document DAO.
*
diff --git a/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/FileDao.java b/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/FileDao.java
index 049a2bb8..d2694bda 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/FileDao.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/FileDao.java
@@ -1,15 +1,14 @@
package com.sismics.docs.core.dao.jpa;
-import java.util.Date;
-import java.util.List;
-import java.util.UUID;
+import com.sismics.docs.core.model.jpa.File;
+import com.sismics.util.context.ThreadLocalContext;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.Query;
-
-import com.sismics.docs.core.model.jpa.File;
-import com.sismics.util.context.ThreadLocalContext;
+import java.util.Date;
+import java.util.List;
+import java.util.UUID;
/**
* File DAO.
diff --git a/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/LocaleDao.java b/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/LocaleDao.java
index b8a4df27..9e022354 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/LocaleDao.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/LocaleDao.java
@@ -1,13 +1,12 @@
package com.sismics.docs.core.dao.jpa;
-import java.util.List;
+import com.sismics.docs.core.model.jpa.Locale;
+import com.sismics.util.context.ThreadLocalContext;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.Query;
-
-import com.sismics.docs.core.model.jpa.Locale;
-import com.sismics.util.context.ThreadLocalContext;
+import java.util.List;
/**
* Locale DAO.
diff --git a/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/RoleBaseFunctionDao.java b/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/RoleBaseFunctionDao.java
index c6012568..25562032 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/RoleBaseFunctionDao.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/RoleBaseFunctionDao.java
@@ -1,13 +1,12 @@
package com.sismics.docs.core.dao.jpa;
-import java.util.Set;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-
import com.google.common.collect.Sets;
import com.sismics.util.context.ThreadLocalContext;
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+import java.util.Set;
+
/**
* Role base functions DAO.
*
diff --git a/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/TagDao.java b/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/TagDao.java
index b1cc4a62..bd5d0783 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/TagDao.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/TagDao.java
@@ -1,21 +1,16 @@
package com.sismics.docs.core.dao.jpa;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Set;
-import java.util.UUID;
-
-import javax.persistence.EntityManager;
-import javax.persistence.NoResultException;
-import javax.persistence.Query;
-
import com.sismics.docs.core.dao.jpa.dto.TagDto;
import com.sismics.docs.core.dao.jpa.dto.TagStatDto;
import com.sismics.docs.core.model.jpa.DocumentTag;
import com.sismics.docs.core.model.jpa.Tag;
import com.sismics.util.context.ThreadLocalContext;
+import javax.persistence.EntityManager;
+import javax.persistence.NoResultException;
+import javax.persistence.Query;
+import java.util.*;
+
/**
* Tag DAO.
*
diff --git a/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/UserDao.java b/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/UserDao.java
index 527ed83f..53d564fa 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/UserDao.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/dao/jpa/UserDao.java
@@ -1,19 +1,5 @@
package com.sismics.docs.core.dao.jpa;
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import javax.persistence.EntityManager;
-import javax.persistence.NoResultException;
-import javax.persistence.Query;
-
-import org.mindrot.jbcrypt.BCrypt;
-
import com.google.common.base.Joiner;
import com.sismics.docs.core.constant.Constants;
import com.sismics.docs.core.dao.jpa.dto.UserDto;
@@ -23,6 +9,13 @@ import com.sismics.docs.core.util.jpa.PaginatedLists;
import com.sismics.docs.core.util.jpa.QueryParam;
import com.sismics.docs.core.util.jpa.SortCriteria;
import com.sismics.util.context.ThreadLocalContext;
+import org.mindrot.jbcrypt.BCrypt;
+
+import javax.persistence.EntityManager;
+import javax.persistence.NoResultException;
+import javax.persistence.Query;
+import java.sql.Timestamp;
+import java.util.*;
/**
* User DAO.
diff --git a/docs-core/src/main/java/com/sismics/docs/core/dao/lucene/DocsStandardAnalyzer.java b/docs-core/src/main/java/com/sismics/docs/core/dao/lucene/DocsStandardAnalyzer.java
index c1fe0153..753b80fb 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/dao/lucene/DocsStandardAnalyzer.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/dao/lucene/DocsStandardAnalyzer.java
@@ -17,9 +17,6 @@ package com.sismics.docs.core.dao.lucene;
* limitations under the License.
*/
-import java.io.IOException;
-import java.io.Reader;
-
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.charfilter.HTMLStripCharFilter;
import org.apache.lucene.analysis.core.LowerCaseFilter;
@@ -33,6 +30,9 @@ import org.apache.lucene.analysis.util.CharArraySet;
import org.apache.lucene.analysis.util.StopwordAnalyzerBase;
import org.apache.lucene.util.Version;
+import java.io.IOException;
+import java.io.Reader;
+
/**
* Filters {@link StandardTokenizer} with {@link StandardFilter}, {@link
* LowerCaseFilter} and {@link StopFilter}, using a list of
diff --git a/docs-core/src/main/java/com/sismics/docs/core/listener/sync/DeadEventListener.java b/docs-core/src/main/java/com/sismics/docs/core/listener/sync/DeadEventListener.java
index 35e46bcf..d2306df4 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/listener/sync/DeadEventListener.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/listener/sync/DeadEventListener.java
@@ -1,10 +1,9 @@
package com.sismics.docs.core.listener.sync;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import com.google.common.eventbus.DeadEvent;
import com.google.common.eventbus.Subscribe;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Listener for all unprocessed events.
diff --git a/docs-core/src/main/java/com/sismics/docs/core/model/context/AppContext.java b/docs-core/src/main/java/com/sismics/docs/core/model/context/AppContext.java
index 3ef1bd38..9b5b2bab 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/model/context/AppContext.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/model/context/AppContext.java
@@ -1,14 +1,5 @@
package com.sismics.docs.core.model.context;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.lucene.store.Directory;
-
import com.google.common.eventbus.AsyncEventBus;
import com.google.common.eventbus.EventBus;
import com.sismics.docs.core.constant.ConfigType;
@@ -17,6 +8,14 @@ import com.sismics.docs.core.listener.sync.DeadEventListener;
import com.sismics.docs.core.model.jpa.Config;
import com.sismics.docs.core.service.IndexingService;
import com.sismics.util.EnvironmentUtil;
+import org.apache.lucene.store.Directory;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
/**
* Global application context.
diff --git a/docs-core/src/main/java/com/sismics/docs/core/model/jpa/AuthenticationToken.java b/docs-core/src/main/java/com/sismics/docs/core/model/jpa/AuthenticationToken.java
index e7bb9037..b14a7a83 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/model/jpa/AuthenticationToken.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/model/jpa/AuthenticationToken.java
@@ -1,13 +1,12 @@
package com.sismics.docs.core.model.jpa;
-import java.util.Date;
+import com.google.common.base.Objects;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
-
-import com.google.common.base.Objects;
+import java.util.Date;
/**
* Authentication token entity.
diff --git a/docs-core/src/main/java/com/sismics/docs/core/model/jpa/BaseFunction.java b/docs-core/src/main/java/com/sismics/docs/core/model/jpa/BaseFunction.java
index 3fa48f6f..16abd0c4 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/model/jpa/BaseFunction.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/model/jpa/BaseFunction.java
@@ -1,12 +1,12 @@
package com.sismics.docs.core.model.jpa;
+import com.google.common.base.Objects;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
-import com.google.common.base.Objects;
-
/**
* Base function entity.
*
diff --git a/docs-core/src/main/java/com/sismics/docs/core/model/jpa/Config.java b/docs-core/src/main/java/com/sismics/docs/core/model/jpa/Config.java
index 0e6a6eca..b22522b9 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/model/jpa/Config.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/model/jpa/Config.java
@@ -1,15 +1,10 @@
package com.sismics.docs.core.model.jpa;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
import com.google.common.base.Objects;
import com.sismics.docs.core.constant.ConfigType;
+import javax.persistence.*;
+
/**
* Configuration parameter entity.
*
diff --git a/docs-core/src/main/java/com/sismics/docs/core/model/jpa/Document.java b/docs-core/src/main/java/com/sismics/docs/core/model/jpa/Document.java
index 79329a6c..ccebce2c 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/model/jpa/Document.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/model/jpa/Document.java
@@ -1,13 +1,12 @@
package com.sismics.docs.core.model.jpa;
-import java.util.Date;
+import com.google.common.base.Objects;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
-
-import com.google.common.base.Objects;
+import java.util.Date;
/**
* Document entity.
diff --git a/docs-core/src/main/java/com/sismics/docs/core/model/jpa/DocumentTag.java b/docs-core/src/main/java/com/sismics/docs/core/model/jpa/DocumentTag.java
index cc8a2b8d..0dad273b 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/model/jpa/DocumentTag.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/model/jpa/DocumentTag.java
@@ -1,13 +1,12 @@
package com.sismics.docs.core.model.jpa;
-import java.io.Serializable;
+import com.google.common.base.Objects;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
-
-import com.google.common.base.Objects;
+import java.io.Serializable;
/**
* Link between a document and a tag.
diff --git a/docs-core/src/main/java/com/sismics/docs/core/model/jpa/File.java b/docs-core/src/main/java/com/sismics/docs/core/model/jpa/File.java
index 08ad65d6..a483e0c3 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/model/jpa/File.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/model/jpa/File.java
@@ -1,13 +1,12 @@
package com.sismics.docs.core.model.jpa;
-import java.util.Date;
+import com.google.common.base.Objects;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
-
-import com.google.common.base.Objects;
+import java.util.Date;
/**
* File entity.
diff --git a/docs-core/src/main/java/com/sismics/docs/core/model/jpa/Locale.java b/docs-core/src/main/java/com/sismics/docs/core/model/jpa/Locale.java
index 9e03ad4f..111a850c 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/model/jpa/Locale.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/model/jpa/Locale.java
@@ -1,12 +1,12 @@
package com.sismics.docs.core.model.jpa;
+import com.google.common.base.Objects;
+
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
-import com.google.common.base.Objects;
-
/**
* Locale entity.
*
diff --git a/docs-core/src/main/java/com/sismics/docs/core/model/jpa/Role.java b/docs-core/src/main/java/com/sismics/docs/core/model/jpa/Role.java
index ebe801bf..c636c3c3 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/model/jpa/Role.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/model/jpa/Role.java
@@ -1,13 +1,12 @@
package com.sismics.docs.core.model.jpa;
-import java.util.Date;
+import com.google.common.base.Objects;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
-
-import com.google.common.base.Objects;
+import java.util.Date;
/**
* Role (set of base functions).
diff --git a/docs-core/src/main/java/com/sismics/docs/core/model/jpa/RoleBaseFunction.java b/docs-core/src/main/java/com/sismics/docs/core/model/jpa/RoleBaseFunction.java
index 7262a7a8..06e1fc96 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/model/jpa/RoleBaseFunction.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/model/jpa/RoleBaseFunction.java
@@ -1,13 +1,12 @@
package com.sismics.docs.core.model.jpa;
-import java.util.Date;
+import com.google.common.base.Objects;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
-
-import com.google.common.base.Objects;
+import java.util.Date;
/**
* Role base function.
diff --git a/docs-core/src/main/java/com/sismics/docs/core/model/jpa/Tag.java b/docs-core/src/main/java/com/sismics/docs/core/model/jpa/Tag.java
index 7371b036..4ad25f8b 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/model/jpa/Tag.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/model/jpa/Tag.java
@@ -1,13 +1,12 @@
package com.sismics.docs.core.model.jpa;
-import java.util.Date;
+import com.google.common.base.Objects;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
-
-import com.google.common.base.Objects;
+import java.util.Date;
/**
* Tag.
diff --git a/docs-core/src/main/java/com/sismics/docs/core/model/jpa/User.java b/docs-core/src/main/java/com/sismics/docs/core/model/jpa/User.java
index ffff44b2..6febd559 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/model/jpa/User.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/model/jpa/User.java
@@ -1,13 +1,12 @@
package com.sismics.docs.core.model.jpa;
-import java.util.Date;
+import com.google.common.base.Objects;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
-
-import com.google.common.base.Objects;
+import java.util.Date;
/**
* User entity.
diff --git a/docs-core/src/main/java/com/sismics/docs/core/service/IndexingService.java b/docs-core/src/main/java/com/sismics/docs/core/service/IndexingService.java
index 3b7f8c9a..1f9513a3 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/service/IndexingService.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/service/IndexingService.java
@@ -1,9 +1,10 @@
package com.sismics.docs.core.service;
-import java.io.File;
-import java.io.IOException;
-import java.util.concurrent.TimeUnit;
-
+import com.google.common.util.concurrent.AbstractScheduledService;
+import com.sismics.docs.core.constant.Constants;
+import com.sismics.docs.core.model.context.AppContext;
+import com.sismics.docs.core.util.DirectoryUtil;
+import com.sismics.docs.core.util.TransactionUtil;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.store.SimpleFSDirectory;
@@ -11,11 +12,9 @@ import org.apache.lucene.store.SimpleFSLockFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.util.concurrent.AbstractScheduledService;
-import com.sismics.docs.core.constant.Constants;
-import com.sismics.docs.core.model.context.AppContext;
-import com.sismics.docs.core.util.DirectoryUtil;
-import com.sismics.docs.core.util.TransactionUtil;
+import java.io.File;
+import java.io.IOException;
+import java.util.concurrent.TimeUnit;
/**
* Indexing service.
diff --git a/docs-core/src/main/java/com/sismics/docs/core/util/ConfigUtil.java b/docs-core/src/main/java/com/sismics/docs/core/util/ConfigUtil.java
index cea179d3..81d5067f 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/util/ConfigUtil.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/util/ConfigUtil.java
@@ -1,11 +1,11 @@
package com.sismics.docs.core.util;
-import java.util.ResourceBundle;
-
import com.sismics.docs.core.constant.ConfigType;
import com.sismics.docs.core.dao.jpa.ConfigDao;
import com.sismics.docs.core.model.jpa.Config;
+import java.util.ResourceBundle;
+
/**
* Configuration parameter utilities.
*
diff --git a/docs-core/src/main/java/com/sismics/docs/core/util/DirectoryUtil.java b/docs-core/src/main/java/com/sismics/docs/core/util/DirectoryUtil.java
index 4cf99269..a4aad893 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/util/DirectoryUtil.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/util/DirectoryUtil.java
@@ -1,10 +1,9 @@
package com.sismics.docs.core.util;
-import java.io.File;
-
+import com.sismics.util.EnvironmentUtil;
import org.apache.commons.lang.StringUtils;
-import com.sismics.util.EnvironmentUtil;
+import java.io.File;
/**
* Utilities to gain access to the storage directories used by the application.
diff --git a/docs-core/src/main/java/com/sismics/docs/core/util/LuceneUtil.java b/docs-core/src/main/java/com/sismics/docs/core/util/LuceneUtil.java
index d2da2de5..9f33bcd2 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/util/LuceneUtil.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/util/LuceneUtil.java
@@ -1,7 +1,7 @@
package com.sismics.docs.core.util;
-import java.io.IOException;
-
+import com.sismics.docs.core.dao.lucene.DocsStandardAnalyzer;
+import com.sismics.docs.core.model.context.AppContext;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.SerialMergeScheduler;
@@ -10,8 +10,7 @@ import org.apache.lucene.util.Version;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.sismics.docs.core.dao.lucene.DocsStandardAnalyzer;
-import com.sismics.docs.core.model.context.AppContext;
+import java.io.IOException;
/**
* Lucene utils.
diff --git a/docs-core/src/main/java/com/sismics/docs/core/util/TransactionUtil.java b/docs-core/src/main/java/com/sismics/docs/core/util/TransactionUtil.java
index ccf961be..a8ab3a37 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/util/TransactionUtil.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/util/TransactionUtil.java
@@ -1,13 +1,12 @@
package com.sismics.docs.core.util;
-import javax.persistence.EntityManager;
-import javax.persistence.EntityTransaction;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import com.sismics.util.context.ThreadLocalContext;
import com.sismics.util.jpa.EMF;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.EntityManager;
+import javax.persistence.EntityTransaction;
/**
* Database transaction utils.
diff --git a/docs-core/src/main/java/com/sismics/docs/core/util/jpa/PaginatedLists.java b/docs-core/src/main/java/com/sismics/docs/core/util/jpa/PaginatedLists.java
index f769fa3b..c1c6affe 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/util/jpa/PaginatedLists.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/util/jpa/PaginatedLists.java
@@ -1,8 +1,7 @@
package com.sismics.docs.core.util.jpa;
-import java.util.List;
-
import javax.persistence.Query;
+import java.util.List;
/**
* Utilities for paginated lists.
diff --git a/docs-core/src/main/java/com/sismics/docs/core/util/jpa/QueryUtil.java b/docs-core/src/main/java/com/sismics/docs/core/util/jpa/QueryUtil.java
index eee6ac6b..fa9090f9 100644
--- a/docs-core/src/main/java/com/sismics/docs/core/util/jpa/QueryUtil.java
+++ b/docs-core/src/main/java/com/sismics/docs/core/util/jpa/QueryUtil.java
@@ -1,11 +1,10 @@
package com.sismics.docs.core.util.jpa;
-import java.util.Map.Entry;
+import com.sismics.util.context.ThreadLocalContext;
import javax.persistence.EntityManager;
import javax.persistence.Query;
-
-import com.sismics.util.context.ThreadLocalContext;
+import java.util.Map.Entry;
/**
* Query utilities.
diff --git a/docs-core/src/main/java/com/sismics/util/DateUtil.java b/docs-core/src/main/java/com/sismics/util/DateUtil.java
index 5c94229a..9b9069db 100644
--- a/docs-core/src/main/java/com/sismics/util/DateUtil.java
+++ b/docs-core/src/main/java/com/sismics/util/DateUtil.java
@@ -1,9 +1,9 @@
package com.sismics.util;
-import java.util.Map.Entry;
-
import com.google.common.collect.ImmutableMap;
+import java.util.Map.Entry;
+
/**
* Date utilities.
*
diff --git a/docs-core/src/main/java/com/sismics/util/FileUtil.java b/docs-core/src/main/java/com/sismics/util/FileUtil.java
index 58e0a7b3..f6d4527c 100644
--- a/docs-core/src/main/java/com/sismics/util/FileUtil.java
+++ b/docs-core/src/main/java/com/sismics/util/FileUtil.java
@@ -1,18 +1,16 @@
package com.sismics.util;
+import com.sismics.docs.core.model.jpa.File;
+import com.sismics.docs.core.util.DirectoryUtil;
+import org.imgscalr.Scalr;
+
+import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
-import javax.imageio.ImageIO;
-
-import org.imgscalr.Scalr;
-
-import com.sismics.docs.core.model.jpa.File;
-import com.sismics.docs.core.util.DirectoryUtil;
-
/**
* File utilities.
*
diff --git a/docs-core/src/main/java/com/sismics/util/HttpUtil.java b/docs-core/src/main/java/com/sismics/util/HttpUtil.java
index 154cd6b1..49cb12e4 100644
--- a/docs-core/src/main/java/com/sismics/util/HttpUtil.java
+++ b/docs-core/src/main/java/com/sismics/util/HttpUtil.java
@@ -1,5 +1,8 @@
package com.sismics.util;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
@@ -7,9 +10,6 @@ import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
/**
* HTTP request utilities.
*
diff --git a/docs-core/src/main/java/com/sismics/util/ImageUtil.java b/docs-core/src/main/java/com/sismics/util/ImageUtil.java
index 91827f7a..70ab1fb2 100644
--- a/docs-core/src/main/java/com/sismics/util/ImageUtil.java
+++ b/docs-core/src/main/java/com/sismics/util/ImageUtil.java
@@ -1,17 +1,16 @@
package com.sismics.util;
-import java.awt.image.BufferedImage;
-import java.io.File;
-import java.io.IOException;
-import java.util.Iterator;
+import com.sismics.util.mime.MimeType;
import javax.imageio.IIOImage;
import javax.imageio.ImageIO;
import javax.imageio.ImageWriteParam;
import javax.imageio.ImageWriter;
import javax.imageio.stream.FileImageOutputStream;
-
-import com.sismics.util.mime.MimeType;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+import java.util.Iterator;
/**
* Image processing utilities.
diff --git a/docs-core/src/main/java/com/sismics/util/JsonValidationUtil.java b/docs-core/src/main/java/com/sismics/util/JsonValidationUtil.java
index ead4073e..85ee0ac4 100644
--- a/docs-core/src/main/java/com/sismics/util/JsonValidationUtil.java
+++ b/docs-core/src/main/java/com/sismics/util/JsonValidationUtil.java
@@ -1,9 +1,9 @@
package com.sismics.util;
-import java.text.MessageFormat;
-
import org.codehaus.jackson.JsonNode;
+import java.text.MessageFormat;
+
/**
* JSON validation utilities.
*
diff --git a/docs-core/src/main/java/com/sismics/util/LocaleUtil.java b/docs-core/src/main/java/com/sismics/util/LocaleUtil.java
index 8799257f..05c26d27 100644
--- a/docs-core/src/main/java/com/sismics/util/LocaleUtil.java
+++ b/docs-core/src/main/java/com/sismics/util/LocaleUtil.java
@@ -1,11 +1,10 @@
package com.sismics.util;
-import java.util.Locale;
-
-import org.apache.commons.lang.StringUtils;
-
import com.sismics.docs.core.constant.Constants;
import com.sismics.docs.core.dao.jpa.LocaleDao;
+import org.apache.commons.lang.StringUtils;
+
+import java.util.Locale;
/**
* Locale utilities.
diff --git a/docs-core/src/main/java/com/sismics/util/ResourceUtil.java b/docs-core/src/main/java/com/sismics/util/ResourceUtil.java
index f1c7a067..e554dce7 100644
--- a/docs-core/src/main/java/com/sismics/util/ResourceUtil.java
+++ b/docs-core/src/main/java/com/sismics/util/ResourceUtil.java
@@ -1,5 +1,7 @@
package com.sismics.util;
+import com.google.common.collect.Lists;
+
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
@@ -7,16 +9,10 @@ import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLDecoder;
import java.text.MessageFormat;
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
-import com.google.common.collect.Lists;
-
/**
* Resource utilities.
*
diff --git a/docs-core/src/main/java/com/sismics/util/jpa/DbOpenHelper.java b/docs-core/src/main/java/com/sismics/util/jpa/DbOpenHelper.java
index ce44090f..47f687c7 100644
--- a/docs-core/src/main/java/com/sismics/util/jpa/DbOpenHelper.java
+++ b/docs-core/src/main/java/com/sismics/util/jpa/DbOpenHelper.java
@@ -1,21 +1,9 @@
package com.sismics.util.jpa;
-import java.io.File;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Writer;
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.ResourceBundle;
-
+import com.google.common.base.Strings;
+import com.google.common.io.CharStreams;
+import com.sismics.docs.core.util.ConfigUtil;
+import com.sismics.util.ResourceUtil;
import org.hibernate.HibernateException;
import org.hibernate.JDBCException;
import org.hibernate.engine.jdbc.internal.FormatStyle;
@@ -27,10 +15,16 @@ import org.hibernate.tool.hbm2ddl.ConnectionHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.base.Strings;
-import com.google.common.io.CharStreams;
-import com.sismics.docs.core.util.ConfigUtil;
-import com.sismics.util.ResourceUtil;
+import java.io.*;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.ResourceBundle;
/**
* A helper to update the database incrementally.
diff --git a/docs-core/src/main/java/com/sismics/util/jpa/EMF.java b/docs-core/src/main/java/com/sismics/util/jpa/EMF.java
index 7a4bf4a5..fee2bb55 100644
--- a/docs-core/src/main/java/com/sismics/util/jpa/EMF.java
+++ b/docs-core/src/main/java/com/sismics/util/jpa/EMF.java
@@ -1,16 +1,6 @@
package com.sismics.util.jpa;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-
+import com.sismics.docs.core.util.DirectoryUtil;
import org.hibernate.cfg.Environment;
import org.hibernate.internal.util.config.ConfigurationHelper;
import org.hibernate.service.ServiceRegistry;
@@ -18,7 +8,15 @@ import org.hibernate.service.ServiceRegistryBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.sismics.docs.core.util.DirectoryUtil;
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.Persistence;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
/**
* Entity manager factory.
diff --git a/docs-core/src/main/java/com/sismics/util/jpa/ManagedProvidedConnectionHelper.java b/docs-core/src/main/java/com/sismics/util/jpa/ManagedProvidedConnectionHelper.java
index 6f2a3e0c..452b692e 100644
--- a/docs-core/src/main/java/com/sismics/util/jpa/ManagedProvidedConnectionHelper.java
+++ b/docs-core/src/main/java/com/sismics/util/jpa/ManagedProvidedConnectionHelper.java
@@ -25,10 +25,6 @@
package com.sismics.util.jpa;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.util.Properties;
-
import org.hibernate.cfg.Environment;
import org.hibernate.engine.jdbc.spi.SqlExceptionHelper;
import org.hibernate.internal.util.config.ConfigurationHelper;
@@ -37,6 +33,10 @@ import org.hibernate.service.internal.StandardServiceRegistryImpl;
import org.hibernate.service.jdbc.connections.spi.ConnectionProvider;
import org.hibernate.tool.hbm2ddl.ConnectionHelper;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.Properties;
+
/**
* A {@link ConnectionHelper} implementation based on an internally
* built and managed {@link ConnectionProvider}.
diff --git a/docs-core/src/main/java/com/sismics/util/jpa/SuppliedConnectionProviderConnectionHelper.java b/docs-core/src/main/java/com/sismics/util/jpa/SuppliedConnectionProviderConnectionHelper.java
index 9544f873..0da68386 100644
--- a/docs-core/src/main/java/com/sismics/util/jpa/SuppliedConnectionProviderConnectionHelper.java
+++ b/docs-core/src/main/java/com/sismics/util/jpa/SuppliedConnectionProviderConnectionHelper.java
@@ -25,13 +25,13 @@
package com.sismics.util.jpa;
-import java.sql.Connection;
-import java.sql.SQLException;
-
import org.hibernate.engine.jdbc.spi.SqlExceptionHelper;
import org.hibernate.service.jdbc.connections.spi.ConnectionProvider;
import org.hibernate.tool.hbm2ddl.ConnectionHelper;
+import java.sql.Connection;
+import java.sql.SQLException;
+
/**
* A {@link ConnectionHelper} implementation based on a provided
* {@link ConnectionProvider}. Essentially, ensures that the connection
diff --git a/docs-core/src/main/java/com/sismics/util/log4j/MemoryAppender.java b/docs-core/src/main/java/com/sismics/util/log4j/MemoryAppender.java
index cc88baad..d8ca314b 100644
--- a/docs-core/src/main/java/com/sismics/util/log4j/MemoryAppender.java
+++ b/docs-core/src/main/java/com/sismics/util/log4j/MemoryAppender.java
@@ -1,18 +1,17 @@
package com.sismics.util.log4j;
+import com.google.common.collect.Lists;
+import com.sismics.docs.core.util.jpa.PaginatedList;
+import org.apache.log4j.AppenderSkeleton;
+import org.apache.log4j.helpers.LogLog;
+import org.apache.log4j.spi.LoggingEvent;
+
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
-import org.apache.log4j.AppenderSkeleton;
-import org.apache.log4j.helpers.LogLog;
-import org.apache.log4j.spi.LoggingEvent;
-
-import com.google.common.collect.Lists;
-import com.sismics.docs.core.util.jpa.PaginatedList;
-
/**
* Memory appender for Log4J.
*
diff --git a/docs-core/src/test/java/com/sismics/docs/BaseTransactionalTest.java b/docs-core/src/test/java/com/sismics/docs/BaseTransactionalTest.java
index 97a297ef..8de90b68 100644
--- a/docs-core/src/test/java/com/sismics/docs/BaseTransactionalTest.java
+++ b/docs-core/src/test/java/com/sismics/docs/BaseTransactionalTest.java
@@ -1,13 +1,12 @@
package com.sismics.docs;
-import javax.persistence.EntityManager;
-import javax.persistence.EntityTransaction;
-
-import org.junit.After;
-import org.junit.Before;
-
import com.sismics.util.context.ThreadLocalContext;
import com.sismics.util.jpa.EMF;
+import org.junit.After;
+import org.junit.Before;
+
+import javax.persistence.EntityManager;
+import javax.persistence.EntityTransaction;
/**
* Base class of tests with a transactional context.
diff --git a/docs-core/src/test/java/com/sismics/docs/core/dao/jpa/TestJpa.java b/docs-core/src/test/java/com/sismics/docs/core/dao/jpa/TestJpa.java
index c24414f5..5fe05a9d 100644
--- a/docs-core/src/test/java/com/sismics/docs/core/dao/jpa/TestJpa.java
+++ b/docs-core/src/test/java/com/sismics/docs/core/dao/jpa/TestJpa.java
@@ -1,13 +1,10 @@
package com.sismics.docs.core.dao.jpa;
-import junit.framework.Assert;
-
-import org.junit.Test;
-
import com.sismics.docs.BaseTransactionalTest;
-import com.sismics.docs.core.dao.jpa.UserDao;
import com.sismics.docs.core.model.jpa.User;
import com.sismics.docs.core.util.TransactionUtil;
+import junit.framework.Assert;
+import org.junit.Test;
/**
* Tests the persistance layer.
diff --git a/docs-core/src/test/java/com/sismics/util/TestDateUtil.java b/docs-core/src/test/java/com/sismics/util/TestDateUtil.java
index 8d0dd750..797904b6 100644
--- a/docs-core/src/test/java/com/sismics/util/TestDateUtil.java
+++ b/docs-core/src/test/java/com/sismics/util/TestDateUtil.java
@@ -1,7 +1,6 @@
package com.sismics.util;
import junit.framework.Assert;
-
import org.junit.Test;
/**
diff --git a/docs-core/src/test/java/com/sismics/util/TestResourceUtil.java b/docs-core/src/test/java/com/sismics/util/TestResourceUtil.java
index 36fc93f4..c780dcf6 100644
--- a/docs-core/src/test/java/com/sismics/util/TestResourceUtil.java
+++ b/docs-core/src/test/java/com/sismics/util/TestResourceUtil.java
@@ -1,11 +1,10 @@
package com.sismics.util;
-import java.util.List;
-
import junit.framework.Assert;
-
import org.junit.Test;
+import java.util.List;
+
/**
* Test of the resource utils.
*
diff --git a/docs-web-common/src/main/java/com/sismics/rest/exception/ClientException.java b/docs-web-common/src/main/java/com/sismics/rest/exception/ClientException.java
index cd90e074..23f75ec8 100644
--- a/docs-web-common/src/main/java/com/sismics/rest/exception/ClientException.java
+++ b/docs-web-common/src/main/java/com/sismics/rest/exception/ClientException.java
@@ -1,15 +1,15 @@
package com.sismics.rest.exception;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-
import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
+
/**
* Jersey exception encapsulating an error from the client (BAD_REQUEST).
*
diff --git a/docs-web-common/src/main/java/com/sismics/rest/exception/ForbiddenClientException.java b/docs-web-common/src/main/java/com/sismics/rest/exception/ForbiddenClientException.java
index 1eac964b..86786d38 100644
--- a/docs-web-common/src/main/java/com/sismics/rest/exception/ForbiddenClientException.java
+++ b/docs-web-common/src/main/java/com/sismics/rest/exception/ForbiddenClientException.java
@@ -1,12 +1,12 @@
package com.sismics.rest.exception;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
+
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
-import org.codehaus.jettison.json.JSONException;
-import org.codehaus.jettison.json.JSONObject;
-
/**
* Unauthorized access to the resource exception.
*
diff --git a/docs-web-common/src/main/java/com/sismics/rest/exception/ServerException.java b/docs-web-common/src/main/java/com/sismics/rest/exception/ServerException.java
index 4dd17826..a2947260 100644
--- a/docs-web-common/src/main/java/com/sismics/rest/exception/ServerException.java
+++ b/docs-web-common/src/main/java/com/sismics/rest/exception/ServerException.java
@@ -1,14 +1,14 @@
package com.sismics.rest.exception;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.codehaus.jettison.json.JSONException;
-import org.codehaus.jettison.json.JSONObject;
-
/**
* Jersey exception encapsulating an error from the client (INTERNAL_SERVER_ERROR).
*
diff --git a/docs-web-common/src/main/java/com/sismics/rest/resource/GenericExceptionMapper.java b/docs-web-common/src/main/java/com/sismics/rest/resource/GenericExceptionMapper.java
index c9e51b29..922368d2 100644
--- a/docs-web-common/src/main/java/com/sismics/rest/resource/GenericExceptionMapper.java
+++ b/docs-web-common/src/main/java/com/sismics/rest/resource/GenericExceptionMapper.java
@@ -1,15 +1,15 @@
package com.sismics.rest.resource;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.ext.ExceptionMapper;
-import javax.ws.rs.ext.Provider;
-
import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.ExceptionMapper;
+import javax.ws.rs.ext.Provider;
+
/**
* Generic exception mapper that transforms all unknown exception into ServerError.
*
diff --git a/docs-web-common/src/main/java/com/sismics/rest/util/ValidationUtil.java b/docs-web-common/src/main/java/com/sismics/rest/util/ValidationUtil.java
index fb7a6b10..8581f028 100644
--- a/docs-web-common/src/main/java/com/sismics/rest/util/ValidationUtil.java
+++ b/docs-web-common/src/main/java/com/sismics/rest/util/ValidationUtil.java
@@ -1,19 +1,18 @@
package com.sismics.rest.util;
-import java.text.MessageFormat;
-import java.util.Date;
-import java.util.List;
-import java.util.regex.Pattern;
-
-import org.apache.commons.lang.StringUtils;
-import org.codehaus.jettison.json.JSONException;
-import org.joda.time.DateTime;
-
import com.google.common.base.Strings;
import com.sismics.docs.core.dao.file.theme.ThemeDao;
import com.sismics.docs.core.dao.jpa.LocaleDao;
import com.sismics.docs.core.model.jpa.Locale;
import com.sismics.rest.exception.ClientException;
+import org.apache.commons.lang.StringUtils;
+import org.codehaus.jettison.json.JSONException;
+import org.joda.time.DateTime;
+
+import java.text.MessageFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.regex.Pattern;
/**
* Utility class to validate parameters.
diff --git a/docs-web-common/src/main/java/com/sismics/security/AnonymousPrincipal.java b/docs-web-common/src/main/java/com/sismics/security/AnonymousPrincipal.java
index d938b156..b2e8198f 100644
--- a/docs-web-common/src/main/java/com/sismics/security/AnonymousPrincipal.java
+++ b/docs-web-common/src/main/java/com/sismics/security/AnonymousPrincipal.java
@@ -1,9 +1,9 @@
package com.sismics.security;
-import java.util.Locale;
-
import org.joda.time.DateTimeZone;
+import java.util.Locale;
+
/**
* Anonymous principal.
*
diff --git a/docs-web-common/src/main/java/com/sismics/security/IPrincipal.java b/docs-web-common/src/main/java/com/sismics/security/IPrincipal.java
index 91774b86..0d1babb2 100644
--- a/docs-web-common/src/main/java/com/sismics/security/IPrincipal.java
+++ b/docs-web-common/src/main/java/com/sismics/security/IPrincipal.java
@@ -1,10 +1,10 @@
package com.sismics.security;
+import org.joda.time.DateTimeZone;
+
import java.security.Principal;
import java.util.Locale;
-import org.joda.time.DateTimeZone;
-
/**
* Interface of principals.
*
diff --git a/docs-web-common/src/main/java/com/sismics/security/UserPrincipal.java b/docs-web-common/src/main/java/com/sismics/security/UserPrincipal.java
index 8a147c4f..4c806624 100644
--- a/docs-web-common/src/main/java/com/sismics/security/UserPrincipal.java
+++ b/docs-web-common/src/main/java/com/sismics/security/UserPrincipal.java
@@ -1,10 +1,10 @@
package com.sismics.security;
+import org.joda.time.DateTimeZone;
+
import java.util.Locale;
import java.util.Set;
-import org.joda.time.DateTimeZone;
-
/**
* Authenticated users principal.
*
diff --git a/docs-web-common/src/main/java/com/sismics/util/filter/RequestContextFilter.java b/docs-web-common/src/main/java/com/sismics/util/filter/RequestContextFilter.java
index 076ff60f..6582c488 100644
--- a/docs-web-common/src/main/java/com/sismics/util/filter/RequestContextFilter.java
+++ b/docs-web-common/src/main/java/com/sismics/util/filter/RequestContextFilter.java
@@ -1,26 +1,5 @@
package com.sismics.util.filter;
-import java.io.File;
-import java.io.IOException;
-import java.text.MessageFormat;
-import java.util.Locale;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityTransaction;
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.log4j.Level;
-import org.apache.log4j.PatternLayout;
-import org.apache.log4j.RollingFileAppender;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import com.sismics.docs.core.constant.Constants;
import com.sismics.docs.core.model.context.AppContext;
import com.sismics.docs.core.util.DirectoryUtil;
@@ -28,6 +7,20 @@ import com.sismics.docs.core.util.TransactionUtil;
import com.sismics.util.EnvironmentUtil;
import com.sismics.util.context.ThreadLocalContext;
import com.sismics.util.jpa.EMF;
+import org.apache.log4j.Level;
+import org.apache.log4j.PatternLayout;
+import org.apache.log4j.RollingFileAppender;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.EntityManager;
+import javax.persistence.EntityTransaction;
+import javax.servlet.*;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.IOException;
+import java.text.MessageFormat;
+import java.util.Locale;
/**
* Filter used to process a couple things in the request context.
diff --git a/docs-web-common/src/main/java/com/sismics/util/filter/TokenBasedSecurityFilter.java b/docs-web-common/src/main/java/com/sismics/util/filter/TokenBasedSecurityFilter.java
index fd2ee5f2..b469885d 100644
--- a/docs-web-common/src/main/java/com/sismics/util/filter/TokenBasedSecurityFilter.java
+++ b/docs-web-common/src/main/java/com/sismics/util/filter/TokenBasedSecurityFilter.java
@@ -1,24 +1,5 @@
package com.sismics.util.filter;
-import java.io.IOException;
-import java.text.MessageFormat;
-import java.util.Date;
-import java.util.Locale;
-import java.util.Set;
-
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-
-import org.joda.time.DateTimeZone;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
import com.sismics.docs.core.constant.Constants;
import com.sismics.docs.core.dao.jpa.AuthenticationTokenDao;
import com.sismics.docs.core.dao.jpa.RoleBaseFunctionDao;
@@ -28,6 +9,18 @@ import com.sismics.docs.core.model.jpa.User;
import com.sismics.security.AnonymousPrincipal;
import com.sismics.security.UserPrincipal;
import com.sismics.util.LocaleUtil;
+import org.joda.time.DateTimeZone;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.*;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+import java.text.MessageFormat;
+import java.util.Date;
+import java.util.Locale;
+import java.util.Set;
/**
* This filter is used to authenticate the user having an active session via an authentication token stored in database.
diff --git a/docs-web-common/src/test/java/com/sismics/docs/rest/BaseJerseyTest.java b/docs-web-common/src/test/java/com/sismics/docs/rest/BaseJerseyTest.java
index 6f11ba35..999ad467 100644
--- a/docs-web-common/src/test/java/com/sismics/docs/rest/BaseJerseyTest.java
+++ b/docs-web-common/src/test/java/com/sismics/docs/rest/BaseJerseyTest.java
@@ -1,16 +1,8 @@
package com.sismics.docs.rest;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.net.URLDecoder;
-import java.util.List;
-
-import javax.mail.MessagingException;
-import javax.mail.internet.MimeMessage;
-import javax.mail.internet.MimeUtility;
-
+import com.sismics.docs.rest.descriptor.JerseyTestWebAppDescriptorFactory;
+import com.sismics.docs.rest.util.ClientUtil;
+import com.sun.jersey.test.framework.JerseyTest;
import org.glassfish.grizzly.http.server.HttpServer;
import org.glassfish.grizzly.http.server.StaticHttpHandler;
import org.junit.After;
@@ -18,9 +10,15 @@ import org.junit.Before;
import org.subethamail.wiser.Wiser;
import org.subethamail.wiser.WiserMessage;
-import com.sismics.docs.rest.descriptor.JerseyTestWebAppDescriptorFactory;
-import com.sismics.docs.rest.util.ClientUtil;
-import com.sun.jersey.test.framework.JerseyTest;
+import javax.mail.MessagingException;
+import javax.mail.internet.MimeMessage;
+import javax.mail.internet.MimeUtility;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.URLDecoder;
+import java.util.List;
/**
* Base class of integration tests with Jersey.
diff --git a/docs-web-common/src/test/java/com/sismics/docs/rest/descriptor/JerseyTestWebAppDescriptorFactory.java b/docs-web-common/src/test/java/com/sismics/docs/rest/descriptor/JerseyTestWebAppDescriptorFactory.java
index 635690fc..6784e216 100644
--- a/docs-web-common/src/test/java/com/sismics/docs/rest/descriptor/JerseyTestWebAppDescriptorFactory.java
+++ b/docs-web-common/src/test/java/com/sismics/docs/rest/descriptor/JerseyTestWebAppDescriptorFactory.java
@@ -1,11 +1,11 @@
package com.sismics.docs.rest.descriptor;
-import java.io.File;
-
import com.sismics.util.filter.RequestContextFilter;
import com.sismics.util.filter.TokenBasedSecurityFilter;
import com.sun.jersey.test.framework.WebAppDescriptor;
+import java.io.File;
+
/**
* Jersey tests Webapp descriptor.
*
diff --git a/docs-web-common/src/test/java/com/sismics/docs/rest/filter/CookieAuthenticationFilter.java b/docs-web-common/src/test/java/com/sismics/docs/rest/filter/CookieAuthenticationFilter.java
index 29f6d3d6..699829a4 100644
--- a/docs-web-common/src/test/java/com/sismics/docs/rest/filter/CookieAuthenticationFilter.java
+++ b/docs-web-common/src/test/java/com/sismics/docs/rest/filter/CookieAuthenticationFilter.java
@@ -1,16 +1,15 @@
package com.sismics.docs.rest.filter;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.ws.rs.core.Cookie;
-
import com.sismics.util.filter.TokenBasedSecurityFilter;
import com.sun.jersey.api.client.ClientHandlerException;
import com.sun.jersey.api.client.ClientRequest;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.filter.ClientFilter;
+import javax.ws.rs.core.Cookie;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* Filter to add the authentication token into a cookie.
*
diff --git a/docs-web-common/src/test/java/com/sismics/docs/rest/util/ClientUtil.java b/docs-web-common/src/test/java/com/sismics/docs/rest/util/ClientUtil.java
index 912df1c3..96e06545 100644
--- a/docs-web-common/src/test/java/com/sismics/docs/rest/util/ClientUtil.java
+++ b/docs-web-common/src/test/java/com/sismics/docs/rest/util/ClientUtil.java
@@ -1,16 +1,15 @@
package com.sismics.docs.rest.util;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.NewCookie;
-
-import junit.framework.Assert;
-
import com.sismics.docs.rest.filter.CookieAuthenticationFilter;
import com.sismics.util.filter.TokenBasedSecurityFilter;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.ClientResponse.Status;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.core.util.MultivaluedMapImpl;
+import junit.framework.Assert;
+
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.NewCookie;
/**
* REST client utilities.
diff --git a/docs-web-common/src/test/java/com/sismics/docs/rest/util/TestValidationUtil.java b/docs-web-common/src/test/java/com/sismics/docs/rest/util/TestValidationUtil.java
index 2ba585db..4d5a289a 100644
--- a/docs-web-common/src/test/java/com/sismics/docs/rest/util/TestValidationUtil.java
+++ b/docs-web-common/src/test/java/com/sismics/docs/rest/util/TestValidationUtil.java
@@ -1,11 +1,9 @@
package com.sismics.docs.rest.util;
-import junit.framework.Assert;
-
-import org.junit.Test;
-
import com.sismics.rest.exception.ClientException;
import com.sismics.rest.util.ValidationUtil;
+import junit.framework.Assert;
+import org.junit.Test;
/**
* Test the validations.
diff --git a/docs-web/src/main/java/com/sismics/docs/rest/constant/BaseFunction.java b/docs-web/src/main/java/com/sismics/docs/rest/constant/BaseFunction.java
index a5912271..d8e02b01 100644
--- a/docs-web/src/main/java/com/sismics/docs/rest/constant/BaseFunction.java
+++ b/docs-web/src/main/java/com/sismics/docs/rest/constant/BaseFunction.java
@@ -10,5 +10,5 @@ public enum BaseFunction {
/**
* Allows the user to use the admin fonctions.
*/
- ADMIN,
+ ADMIN
}
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 b90884d3..6d9d939c 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
@@ -1,22 +1,5 @@
package com.sismics.docs.rest.resource;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ResourceBundle;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Appender;
-import org.apache.log4j.Logger;
-import org.codehaus.jettison.json.JSONException;
-import org.codehaus.jettison.json.JSONObject;
-
import com.sismics.docs.core.dao.jpa.DocumentDao;
import com.sismics.docs.core.dao.jpa.criteria.DocumentCriteria;
import com.sismics.docs.core.dao.jpa.dto.DocumentDto;
@@ -30,6 +13,21 @@ import com.sismics.rest.exception.ServerException;
import com.sismics.util.log4j.LogCriteria;
import com.sismics.util.log4j.LogEntry;
import com.sismics.util.log4j.MemoryAppender;
+import org.apache.commons.lang.StringUtils;
+import org.apache.log4j.Appender;
+import org.apache.log4j.Logger;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.ResourceBundle;
/**
* General app REST resource.
diff --git a/docs-web/src/main/java/com/sismics/docs/rest/resource/BaseResource.java b/docs-web/src/main/java/com/sismics/docs/rest/resource/BaseResource.java
index a6d9ffa4..cac09fa9 100644
--- a/docs-web/src/main/java/com/sismics/docs/rest/resource/BaseResource.java
+++ b/docs-web/src/main/java/com/sismics/docs/rest/resource/BaseResource.java
@@ -1,19 +1,17 @@
package com.sismics.docs.rest.resource;
-import java.security.Principal;
-import java.util.Set;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Context;
-
-import org.codehaus.jettison.json.JSONException;
-
import com.sismics.docs.rest.constant.BaseFunction;
import com.sismics.rest.exception.ForbiddenClientException;
import com.sismics.security.IPrincipal;
import com.sismics.security.UserPrincipal;
import com.sismics.util.filter.TokenBasedSecurityFilter;
+import org.codehaus.jettison.json.JSONException;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import java.security.Principal;
+import java.util.Set;
/**
* Base class of REST resources.
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 ca7c3ad7..a6413223 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
@@ -1,29 +1,5 @@
package com.sismics.docs.rest.resource;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.persistence.NoResultException;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.FormParam;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.apache.commons.lang.StringUtils;
-import org.codehaus.jettison.json.JSONException;
-import org.codehaus.jettison.json.JSONObject;
-
import com.google.common.base.Strings;
import com.sismics.docs.core.dao.jpa.DocumentDao;
import com.sismics.docs.core.dao.jpa.TagDao;
@@ -38,6 +14,16 @@ import com.sismics.docs.core.util.jpa.SortCriteria;
import com.sismics.rest.exception.ClientException;
import com.sismics.rest.exception.ForbiddenClientException;
import com.sismics.rest.util.ValidationUtil;
+import org.apache.commons.lang.StringUtils;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
+
+import javax.persistence.NoResultException;
+import javax.ws.rs.*;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import java.text.MessageFormat;
+import java.util.*;
/**
* Document REST resources.
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 f6f1aeca..c7080e97 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
@@ -1,31 +1,5 @@
package com.sismics.docs.rest.resource;
-import java.io.BufferedInputStream;
-import java.io.InputStream;
-import java.nio.file.Paths;
-import java.text.MessageFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import javax.persistence.NoResultException;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.FormParam;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.codehaus.jettison.json.JSONException;
-import org.codehaus.jettison.json.JSONObject;
-
import com.sismics.docs.core.dao.jpa.DocumentDao;
import com.sismics.docs.core.dao.jpa.FileDao;
import com.sismics.docs.core.model.jpa.Document;
@@ -40,6 +14,21 @@ import com.sismics.util.ImageUtil;
import com.sismics.util.mime.MimeTypeUtil;
import com.sun.jersey.multipart.FormDataBodyPart;
import com.sun.jersey.multipart.FormDataParam;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
+
+import javax.persistence.NoResultException;
+import javax.ws.rs.*;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import java.io.BufferedInputStream;
+import java.io.InputStream;
+import java.nio.file.Paths;
+import java.text.MessageFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
/**
* File REST resources.
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 821d9745..df158548 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
@@ -1,19 +1,17 @@
package com.sismics.docs.rest.resource;
-import java.util.ArrayList;
-import java.util.List;
+import com.sismics.docs.core.dao.jpa.LocaleDao;
+import com.sismics.docs.core.model.jpa.Locale;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-
-import org.codehaus.jettison.json.JSONException;
-import org.codehaus.jettison.json.JSONObject;
-
-import com.sismics.docs.core.dao.jpa.LocaleDao;
-import com.sismics.docs.core.model.jpa.Locale;
+import java.util.ArrayList;
+import java.util.List;
/**
* Locale REST resources.
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 1270e618..70eaee96 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
@@ -1,30 +1,21 @@
package com.sismics.docs.rest.resource;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.ws.rs.DELETE;
-import javax.ws.rs.FormParam;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.apache.commons.lang.StringUtils;
-import org.codehaus.jettison.json.JSONException;
-import org.codehaus.jettison.json.JSONObject;
-
import com.sismics.docs.core.dao.jpa.TagDao;
import com.sismics.docs.core.dao.jpa.dto.TagStatDto;
import com.sismics.docs.core.model.jpa.Tag;
import com.sismics.rest.exception.ClientException;
import com.sismics.rest.exception.ForbiddenClientException;
import com.sismics.rest.util.ValidationUtil;
+import org.apache.commons.lang.StringUtils;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
+
+import javax.ws.rs.*;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.List;
/**
* Tag REST resources.
diff --git a/docs-web/src/main/java/com/sismics/docs/rest/resource/TextPlainMessageBodyWriter.java b/docs-web/src/main/java/com/sismics/docs/rest/resource/TextPlainMessageBodyWriter.java
index 854e9fac..92a3589b 100644
--- a/docs-web/src/main/java/com/sismics/docs/rest/resource/TextPlainMessageBodyWriter.java
+++ b/docs-web/src/main/java/com/sismics/docs/rest/resource/TextPlainMessageBodyWriter.java
@@ -1,10 +1,8 @@
package com.sismics.docs.rest.resource;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
+import com.sun.jersey.core.util.ReaderWriter;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
import javax.ws.rs.Produces;
import javax.ws.rs.WebApplicationException;
@@ -12,11 +10,11 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyWriter;
import javax.ws.rs.ext.Provider;
-
-import org.codehaus.jettison.json.JSONException;
-import org.codehaus.jettison.json.JSONObject;
-
-import com.sun.jersey.core.util.ReaderWriter;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
/**
* MessageBodyWriter personalized to write JSON despite the text/plain MIME type.
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 e30a4a8b..af163421 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
@@ -1,18 +1,16 @@
package com.sismics.docs.rest.resource;
-import java.util.ArrayList;
-import java.util.List;
+import com.sismics.docs.core.dao.file.theme.ThemeDao;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-
-import org.codehaus.jettison.json.JSONException;
-import org.codehaus.jettison.json.JSONObject;
-
-import com.sismics.docs.core.dao.file.theme.ThemeDao;
+import java.util.ArrayList;
+import java.util.List;
/**
* Theme REST resources.
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 6344d43c..6a5a7d3d 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
@@ -1,29 +1,5 @@
package com.sismics.docs.rest.resource;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Set;
-
-import javax.servlet.http.Cookie;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.FormParam;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.NewCookie;
-import javax.ws.rs.core.Response;
-
-import org.apache.commons.lang.StringUtils;
-import org.codehaus.jettison.json.JSONArray;
-import org.codehaus.jettison.json.JSONException;
-import org.codehaus.jettison.json.JSONObject;
-
import com.sismics.docs.core.constant.Constants;
import com.sismics.docs.core.dao.jpa.AuthenticationTokenDao;
import com.sismics.docs.core.dao.jpa.RoleBaseFunctionDao;
@@ -42,6 +18,20 @@ import com.sismics.rest.util.ValidationUtil;
import com.sismics.security.UserPrincipal;
import com.sismics.util.LocaleUtil;
import com.sismics.util.filter.TokenBasedSecurityFilter;
+import org.apache.commons.lang.StringUtils;
+import org.codehaus.jettison.json.JSONArray;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
+
+import javax.servlet.http.Cookie;
+import javax.ws.rs.*;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.NewCookie;
+import javax.ws.rs.core.Response;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
/**
* User REST resources.
diff --git a/docs-web/src/test/java/com/sismics/docs/rest/TestAppResource.java b/docs-web/src/test/java/com/sismics/docs/rest/TestAppResource.java
index 0123ed49..b35f340e 100644
--- a/docs-web/src/test/java/com/sismics/docs/rest/TestAppResource.java
+++ b/docs-web/src/test/java/com/sismics/docs/rest/TestAppResource.java
@@ -1,17 +1,14 @@
package com.sismics.docs.rest;
-import junit.framework.Assert;
-
-import org.codehaus.jettison.json.JSONArray;
-import org.codehaus.jettison.json.JSONException;
-import org.codehaus.jettison.json.JSONObject;
-import org.junit.Test;
-
-import com.sismics.docs.rest.BaseJerseyTest;
import com.sismics.docs.rest.filter.CookieAuthenticationFilter;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.ClientResponse.Status;
import com.sun.jersey.api.client.WebResource;
+import junit.framework.Assert;
+import org.codehaus.jettison.json.JSONArray;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
+import org.junit.Test;
/**
* Test the app resource.
diff --git a/docs-web/src/test/java/com/sismics/docs/rest/TestDocumentResource.java b/docs-web/src/test/java/com/sismics/docs/rest/TestDocumentResource.java
index 48d06e69..0266edfa 100644
--- a/docs-web/src/test/java/com/sismics/docs/rest/TestDocumentResource.java
+++ b/docs-web/src/test/java/com/sismics/docs/rest/TestDocumentResource.java
@@ -1,20 +1,18 @@
package com.sismics.docs.rest;
-import java.util.Date;
-
-import junit.framework.Assert;
-
-import org.codehaus.jettison.json.JSONArray;
-import org.codehaus.jettison.json.JSONException;
-import org.codehaus.jettison.json.JSONObject;
-import org.junit.Test;
-
import com.sismics.docs.rest.filter.CookieAuthenticationFilter;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.ClientResponse.Status;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.core.util.MultivaluedMapImpl;
+import junit.framework.Assert;
+import org.codehaus.jettison.json.JSONArray;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
+import org.junit.Test;
+
+import java.util.Date;
/**
* Exhaustive test of the document resource.
diff --git a/docs-web/src/test/java/com/sismics/docs/rest/TestFileResource.java b/docs-web/src/test/java/com/sismics/docs/rest/TestFileResource.java
index 7d98b15b..111ecd1b 100644
--- a/docs-web/src/test/java/com/sismics/docs/rest/TestFileResource.java
+++ b/docs-web/src/test/java/com/sismics/docs/rest/TestFileResource.java
@@ -1,16 +1,5 @@
package com.sismics.docs.rest;
-import java.io.BufferedInputStream;
-import java.io.InputStream;
-
-import javax.ws.rs.core.MediaType;
-
-import junit.framework.Assert;
-
-import org.codehaus.jettison.json.JSONArray;
-import org.codehaus.jettison.json.JSONObject;
-import org.junit.Test;
-
import com.google.common.io.ByteStreams;
import com.sismics.docs.rest.filter.CookieAuthenticationFilter;
import com.sismics.util.mime.MimeType;
@@ -20,6 +9,14 @@ import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.core.util.MultivaluedMapImpl;
import com.sun.jersey.multipart.FormDataBodyPart;
import com.sun.jersey.multipart.FormDataMultiPart;
+import junit.framework.Assert;
+import org.codehaus.jettison.json.JSONArray;
+import org.codehaus.jettison.json.JSONObject;
+import org.junit.Test;
+
+import javax.ws.rs.core.MediaType;
+import java.io.BufferedInputStream;
+import java.io.InputStream;
/**
* Exhaustive test of the document resource.
diff --git a/docs-web/src/test/java/com/sismics/docs/rest/TestLocaleResource.java b/docs-web/src/test/java/com/sismics/docs/rest/TestLocaleResource.java
index c2c000bb..6b2923d9 100644
--- a/docs-web/src/test/java/com/sismics/docs/rest/TestLocaleResource.java
+++ b/docs-web/src/test/java/com/sismics/docs/rest/TestLocaleResource.java
@@ -1,17 +1,14 @@
package com.sismics.docs.rest;
+import com.sun.jersey.api.client.ClientResponse;
+import com.sun.jersey.api.client.ClientResponse.Status;
+import com.sun.jersey.api.client.WebResource;
import junit.framework.Assert;
-
import org.codehaus.jettison.json.JSONArray;
import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;
import org.junit.Test;
-import com.sismics.docs.rest.BaseJerseyTest;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.api.client.ClientResponse.Status;
-import com.sun.jersey.api.client.WebResource;
-
/**
* Test the locale resource.
*
diff --git a/docs-web/src/test/java/com/sismics/docs/rest/TestSecurity.java b/docs-web/src/test/java/com/sismics/docs/rest/TestSecurity.java
index de34a581..f3bb70b1 100644
--- a/docs-web/src/test/java/com/sismics/docs/rest/TestSecurity.java
+++ b/docs-web/src/test/java/com/sismics/docs/rest/TestSecurity.java
@@ -1,18 +1,15 @@
package com.sismics.docs.rest;
-import junit.framework.Assert;
-
-import org.apache.commons.lang.StringUtils;
-import org.codehaus.jettison.json.JSONException;
-import org.codehaus.jettison.json.JSONObject;
-import org.junit.Test;
-
-import com.sismics.docs.rest.BaseJerseyTest;
import com.sismics.docs.rest.filter.CookieAuthenticationFilter;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.ClientResponse.Status;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.core.util.MultivaluedMapImpl;
+import junit.framework.Assert;
+import org.apache.commons.lang.StringUtils;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
+import org.junit.Test;
/**
* Test of the security layer.
diff --git a/docs-web/src/test/java/com/sismics/docs/rest/TestTagResource.java b/docs-web/src/test/java/com/sismics/docs/rest/TestTagResource.java
index 64923683..ac50dda6 100644
--- a/docs-web/src/test/java/com/sismics/docs/rest/TestTagResource.java
+++ b/docs-web/src/test/java/com/sismics/docs/rest/TestTagResource.java
@@ -1,17 +1,15 @@
package com.sismics.docs.rest;
-import junit.framework.Assert;
-
-import org.codehaus.jettison.json.JSONArray;
-import org.codehaus.jettison.json.JSONException;
-import org.codehaus.jettison.json.JSONObject;
-import org.junit.Test;
-
import com.sismics.docs.rest.filter.CookieAuthenticationFilter;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.ClientResponse.Status;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.core.util.MultivaluedMapImpl;
+import junit.framework.Assert;
+import org.codehaus.jettison.json.JSONArray;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
+import org.junit.Test;
/**
* Test the tag resource.
diff --git a/docs-web/src/test/java/com/sismics/docs/rest/TestThemeResource.java b/docs-web/src/test/java/com/sismics/docs/rest/TestThemeResource.java
index 4388f846..b396c4b1 100644
--- a/docs-web/src/test/java/com/sismics/docs/rest/TestThemeResource.java
+++ b/docs-web/src/test/java/com/sismics/docs/rest/TestThemeResource.java
@@ -1,17 +1,14 @@
package com.sismics.docs.rest;
+import com.sun.jersey.api.client.ClientResponse;
+import com.sun.jersey.api.client.ClientResponse.Status;
+import com.sun.jersey.api.client.WebResource;
import junit.framework.Assert;
-
import org.codehaus.jettison.json.JSONArray;
import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;
import org.junit.Test;
-import com.sismics.docs.rest.BaseJerseyTest;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.api.client.ClientResponse.Status;
-import com.sun.jersey.api.client.WebResource;
-
/**
* Test the theme resource.
*
diff --git a/docs-web/src/test/java/com/sismics/docs/rest/TestUserResource.java b/docs-web/src/test/java/com/sismics/docs/rest/TestUserResource.java
index 0421fb69..b36f3105 100644
--- a/docs-web/src/test/java/com/sismics/docs/rest/TestUserResource.java
+++ b/docs-web/src/test/java/com/sismics/docs/rest/TestUserResource.java
@@ -1,22 +1,18 @@
package com.sismics.docs.rest;
-import java.util.Locale;
-
-import javax.ws.rs.core.MultivaluedMap;
-
-import junit.framework.Assert;
-
-import org.codehaus.jettison.json.JSONArray;
-import org.codehaus.jettison.json.JSONException;
-import org.codehaus.jettison.json.JSONObject;
-import org.junit.Test;
-
-import com.sismics.docs.rest.BaseJerseyTest;
import com.sismics.docs.rest.filter.CookieAuthenticationFilter;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.ClientResponse.Status;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.core.util.MultivaluedMapImpl;
+import junit.framework.Assert;
+import org.codehaus.jettison.json.JSONArray;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
+import org.junit.Test;
+
+import javax.ws.rs.core.MultivaluedMap;
+import java.util.Locale;
/**
* Exhaustive test of the user resource.