Cleanup imports

This commit is contained in:
jendib 2013-08-13 20:08:14 +02:00
parent b6369ed543
commit 48d363352c
81 changed files with 409 additions and 552 deletions

View File

@ -2,7 +2,11 @@
<project version="4"> <project version="4">
<component name="ProjectCodeStyleSettingsManager"> <component name="ProjectCodeStyleSettingsManager">
<option name="PER_PROJECT_SETTINGS"> <option name="PER_PROJECT_SETTINGS">
<value /> <value>
<XML>
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
</XML>
</value>
</option> </option>
</component> </component>
</project> </project>

View File

@ -10,6 +10,24 @@
<file type="web" url="file://$PROJECT_DIR$/docs-web" /> <file type="web" url="file://$PROJECT_DIR$/docs-web" />
</component> </component>
<component name="IdProvider" IDEtalkID="720E2E9A7F0B51A7BEEE864EF64D95F2" /> <component name="IdProvider" IDEtalkID="720E2E9A7F0B51A7BEEE864EF64D95F2" />
<component name="JavadocGenerationManager">
<option name="OUTPUT_DIRECTORY" />
<option name="OPTION_SCOPE" value="protected" />
<option name="OPTION_HIERARCHY" value="true" />
<option name="OPTION_NAVIGATOR" value="true" />
<option name="OPTION_INDEX" value="true" />
<option name="OPTION_SEPARATE_INDEX" value="true" />
<option name="OPTION_DOCUMENT_TAG_USE" value="false" />
<option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" />
<option name="OPTION_DOCUMENT_TAG_VERSION" value="false" />
<option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true" />
<option name="OPTION_DEPRECATED_LIST" value="true" />
<option name="OTHER_OPTIONS" value="" />
<option name="HEAP_SIZE" />
<option name="LOCALE" />
<option name="OPEN_IN_BROWSER" value="true" />
<option name="OPTION_INCLUDE_LIBS" value="false" />
</component>
<component name="MavenProjectsManager"> <component name="MavenProjectsManager">
<option name="originalFiles"> <option name="originalFiles">
<list> <list>

View File

@ -1,13 +1,13 @@
package com.sismics.docs.core.dao.file.theme; 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.File;
import java.io.FilenameFilter; import java.io.FilenameFilter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.google.common.collect.Lists;
import com.sismics.docs.core.util.DirectoryUtil;
/** /**
* Theme DAO. * Theme DAO.
* *

View File

@ -1,16 +1,14 @@
package com.sismics.docs.core.dao.jpa; 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.docs.core.model.jpa.AuthenticationToken;
import com.sismics.util.context.ThreadLocalContext; 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. * Authentication token DAO.

View File

@ -1,12 +1,12 @@
package com.sismics.docs.core.dao.jpa; 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.constant.ConfigType;
import com.sismics.docs.core.model.jpa.Config; import com.sismics.docs.core.model.jpa.Config;
import com.sismics.util.context.ThreadLocalContext; import com.sismics.util.context.ThreadLocalContext;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
/** /**
* Configuration parameter DAO. * Configuration parameter DAO.
* *

View File

@ -1,17 +1,5 @@
package com.sismics.docs.core.dao.jpa; 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.google.common.base.Joiner;
import com.sismics.docs.core.dao.jpa.criteria.DocumentCriteria; import com.sismics.docs.core.dao.jpa.criteria.DocumentCriteria;
import com.sismics.docs.core.dao.jpa.dto.DocumentDto; 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.docs.core.util.jpa.SortCriteria;
import com.sismics.util.context.ThreadLocalContext; 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. * Document DAO.
* *

View File

@ -1,15 +1,14 @@
package com.sismics.docs.core.dao.jpa; package com.sismics.docs.core.dao.jpa;
import java.util.Date; import com.sismics.docs.core.model.jpa.File;
import java.util.List; import com.sismics.util.context.ThreadLocalContext;
import java.util.UUID;
import javax.persistence.EntityManager; import javax.persistence.EntityManager;
import javax.persistence.NoResultException; import javax.persistence.NoResultException;
import javax.persistence.Query; import javax.persistence.Query;
import java.util.Date;
import com.sismics.docs.core.model.jpa.File; import java.util.List;
import com.sismics.util.context.ThreadLocalContext; import java.util.UUID;
/** /**
* File DAO. * File DAO.

View File

@ -1,13 +1,12 @@
package com.sismics.docs.core.dao.jpa; 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.EntityManager;
import javax.persistence.NoResultException; import javax.persistence.NoResultException;
import javax.persistence.Query; import javax.persistence.Query;
import java.util.List;
import com.sismics.docs.core.model.jpa.Locale;
import com.sismics.util.context.ThreadLocalContext;
/** /**
* Locale DAO. * Locale DAO.

View File

@ -1,13 +1,12 @@
package com.sismics.docs.core.dao.jpa; 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.google.common.collect.Sets;
import com.sismics.util.context.ThreadLocalContext; import com.sismics.util.context.ThreadLocalContext;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import java.util.Set;
/** /**
* Role base functions DAO. * Role base functions DAO.
* *

View File

@ -1,21 +1,16 @@
package com.sismics.docs.core.dao.jpa; 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.TagDto;
import com.sismics.docs.core.dao.jpa.dto.TagStatDto; import com.sismics.docs.core.dao.jpa.dto.TagStatDto;
import com.sismics.docs.core.model.jpa.DocumentTag; import com.sismics.docs.core.model.jpa.DocumentTag;
import com.sismics.docs.core.model.jpa.Tag; import com.sismics.docs.core.model.jpa.Tag;
import com.sismics.util.context.ThreadLocalContext; import com.sismics.util.context.ThreadLocalContext;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.Query;
import java.util.*;
/** /**
* Tag DAO. * Tag DAO.
* *

View File

@ -1,19 +1,5 @@
package com.sismics.docs.core.dao.jpa; 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.google.common.base.Joiner;
import com.sismics.docs.core.constant.Constants; import com.sismics.docs.core.constant.Constants;
import com.sismics.docs.core.dao.jpa.dto.UserDto; 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.QueryParam;
import com.sismics.docs.core.util.jpa.SortCriteria; import com.sismics.docs.core.util.jpa.SortCriteria;
import com.sismics.util.context.ThreadLocalContext; 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. * User DAO.

View File

@ -17,9 +17,6 @@ package com.sismics.docs.core.dao.lucene;
* limitations under the License. * limitations under the License.
*/ */
import java.io.IOException;
import java.io.Reader;
import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.charfilter.HTMLStripCharFilter; import org.apache.lucene.analysis.charfilter.HTMLStripCharFilter;
import org.apache.lucene.analysis.core.LowerCaseFilter; 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.analysis.util.StopwordAnalyzerBase;
import org.apache.lucene.util.Version; import org.apache.lucene.util.Version;
import java.io.IOException;
import java.io.Reader;
/** /**
* Filters {@link StandardTokenizer} with {@link StandardFilter}, {@link * Filters {@link StandardTokenizer} with {@link StandardFilter}, {@link
* LowerCaseFilter} and {@link StopFilter}, using a list of * LowerCaseFilter} and {@link StopFilter}, using a list of

View File

@ -1,10 +1,9 @@
package com.sismics.docs.core.listener.sync; 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.DeadEvent;
import com.google.common.eventbus.Subscribe; import com.google.common.eventbus.Subscribe;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* Listener for all unprocessed events. * Listener for all unprocessed events.

View File

@ -1,14 +1,5 @@
package com.sismics.docs.core.model.context; 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.AsyncEventBus;
import com.google.common.eventbus.EventBus; import com.google.common.eventbus.EventBus;
import com.sismics.docs.core.constant.ConfigType; 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.model.jpa.Config;
import com.sismics.docs.core.service.IndexingService; import com.sismics.docs.core.service.IndexingService;
import com.sismics.util.EnvironmentUtil; 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. * Global application context.

View File

@ -1,13 +1,12 @@
package com.sismics.docs.core.model.jpa; package com.sismics.docs.core.model.jpa;
import java.util.Date; import com.google.common.base.Objects;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import java.util.Date;
import com.google.common.base.Objects;
/** /**
* Authentication token entity. * Authentication token entity.

View File

@ -1,12 +1,12 @@
package com.sismics.docs.core.model.jpa; package com.sismics.docs.core.model.jpa;
import com.google.common.base.Objects;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import com.google.common.base.Objects;
/** /**
* Base function entity. * Base function entity.
* *

View File

@ -1,15 +1,10 @@
package com.sismics.docs.core.model.jpa; 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.google.common.base.Objects;
import com.sismics.docs.core.constant.ConfigType; import com.sismics.docs.core.constant.ConfigType;
import javax.persistence.*;
/** /**
* Configuration parameter entity. * Configuration parameter entity.
* *

View File

@ -1,13 +1,12 @@
package com.sismics.docs.core.model.jpa; package com.sismics.docs.core.model.jpa;
import java.util.Date; import com.google.common.base.Objects;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import java.util.Date;
import com.google.common.base.Objects;
/** /**
* Document entity. * Document entity.

View File

@ -1,13 +1,12 @@
package com.sismics.docs.core.model.jpa; package com.sismics.docs.core.model.jpa;
import java.io.Serializable; import com.google.common.base.Objects;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import java.io.Serializable;
import com.google.common.base.Objects;
/** /**
* Link between a document and a tag. * Link between a document and a tag.

View File

@ -1,13 +1,12 @@
package com.sismics.docs.core.model.jpa; package com.sismics.docs.core.model.jpa;
import java.util.Date; import com.google.common.base.Objects;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import java.util.Date;
import com.google.common.base.Objects;
/** /**
* File entity. * File entity.

View File

@ -1,12 +1,12 @@
package com.sismics.docs.core.model.jpa; package com.sismics.docs.core.model.jpa;
import com.google.common.base.Objects;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import com.google.common.base.Objects;
/** /**
* Locale entity. * Locale entity.
* *

View File

@ -1,13 +1,12 @@
package com.sismics.docs.core.model.jpa; package com.sismics.docs.core.model.jpa;
import java.util.Date; import com.google.common.base.Objects;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import java.util.Date;
import com.google.common.base.Objects;
/** /**
* Role (set of base functions). * Role (set of base functions).

View File

@ -1,13 +1,12 @@
package com.sismics.docs.core.model.jpa; package com.sismics.docs.core.model.jpa;
import java.util.Date; import com.google.common.base.Objects;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import java.util.Date;
import com.google.common.base.Objects;
/** /**
* Role base function. * Role base function.

View File

@ -1,13 +1,12 @@
package com.sismics.docs.core.model.jpa; package com.sismics.docs.core.model.jpa;
import java.util.Date; import com.google.common.base.Objects;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import java.util.Date;
import com.google.common.base.Objects;
/** /**
* Tag. * Tag.

View File

@ -1,13 +1,12 @@
package com.sismics.docs.core.model.jpa; package com.sismics.docs.core.model.jpa;
import java.util.Date; import com.google.common.base.Objects;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import java.util.Date;
import com.google.common.base.Objects;
/** /**
* User entity. * User entity.

View File

@ -1,9 +1,10 @@
package com.sismics.docs.core.service; package com.sismics.docs.core.service;
import java.io.File; import com.google.common.util.concurrent.AbstractScheduledService;
import java.io.IOException; import com.sismics.docs.core.constant.Constants;
import java.util.concurrent.TimeUnit; 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.Directory;
import org.apache.lucene.store.RAMDirectory; import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.store.SimpleFSDirectory; import org.apache.lucene.store.SimpleFSDirectory;
@ -11,11 +12,9 @@ import org.apache.lucene.store.SimpleFSLockFactory;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import com.google.common.util.concurrent.AbstractScheduledService; import java.io.File;
import com.sismics.docs.core.constant.Constants; import java.io.IOException;
import com.sismics.docs.core.model.context.AppContext; import java.util.concurrent.TimeUnit;
import com.sismics.docs.core.util.DirectoryUtil;
import com.sismics.docs.core.util.TransactionUtil;
/** /**
* Indexing service. * Indexing service.

View File

@ -1,11 +1,11 @@
package com.sismics.docs.core.util; package com.sismics.docs.core.util;
import java.util.ResourceBundle;
import com.sismics.docs.core.constant.ConfigType; import com.sismics.docs.core.constant.ConfigType;
import com.sismics.docs.core.dao.jpa.ConfigDao; import com.sismics.docs.core.dao.jpa.ConfigDao;
import com.sismics.docs.core.model.jpa.Config; import com.sismics.docs.core.model.jpa.Config;
import java.util.ResourceBundle;
/** /**
* Configuration parameter utilities. * Configuration parameter utilities.
* *

View File

@ -1,10 +1,9 @@
package com.sismics.docs.core.util; package com.sismics.docs.core.util;
import java.io.File; import com.sismics.util.EnvironmentUtil;
import org.apache.commons.lang.StringUtils; 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. * Utilities to gain access to the storage directories used by the application.

View File

@ -1,7 +1,7 @@
package com.sismics.docs.core.util; 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.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.SerialMergeScheduler; import org.apache.lucene.index.SerialMergeScheduler;
@ -10,8 +10,7 @@ import org.apache.lucene.util.Version;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import com.sismics.docs.core.dao.lucene.DocsStandardAnalyzer; import java.io.IOException;
import com.sismics.docs.core.model.context.AppContext;
/** /**
* Lucene utils. * Lucene utils.

View File

@ -1,13 +1,12 @@
package com.sismics.docs.core.util; 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.context.ThreadLocalContext;
import com.sismics.util.jpa.EMF; 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. * Database transaction utils.

View File

@ -1,8 +1,7 @@
package com.sismics.docs.core.util.jpa; package com.sismics.docs.core.util.jpa;
import java.util.List;
import javax.persistence.Query; import javax.persistence.Query;
import java.util.List;
/** /**
* Utilities for paginated lists. * Utilities for paginated lists.

View File

@ -1,11 +1,10 @@
package com.sismics.docs.core.util.jpa; 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.EntityManager;
import javax.persistence.Query; import javax.persistence.Query;
import java.util.Map.Entry;
import com.sismics.util.context.ThreadLocalContext;
/** /**
* Query utilities. * Query utilities.

View File

@ -1,9 +1,9 @@
package com.sismics.util; package com.sismics.util;
import java.util.Map.Entry;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import java.util.Map.Entry;
/** /**
* Date utilities. * Date utilities.
* *

View File

@ -1,18 +1,16 @@
package com.sismics.util; 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.awt.image.BufferedImage;
import java.io.InputStream; import java.io.InputStream;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; 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. * File utilities.
* *

View File

@ -1,5 +1,8 @@
package com.sismics.util; package com.sismics.util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
@ -7,9 +10,6 @@ import java.io.OutputStreamWriter;
import java.net.URL; import java.net.URL;
import java.net.URLConnection; import java.net.URLConnection;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* HTTP request utilities. * HTTP request utilities.
* *

View File

@ -1,17 +1,16 @@
package com.sismics.util; package com.sismics.util;
import java.awt.image.BufferedImage; import com.sismics.util.mime.MimeType;
import java.io.File;
import java.io.IOException;
import java.util.Iterator;
import javax.imageio.IIOImage; import javax.imageio.IIOImage;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import javax.imageio.ImageWriteParam; import javax.imageio.ImageWriteParam;
import javax.imageio.ImageWriter; import javax.imageio.ImageWriter;
import javax.imageio.stream.FileImageOutputStream; import javax.imageio.stream.FileImageOutputStream;
import java.awt.image.BufferedImage;
import com.sismics.util.mime.MimeType; import java.io.File;
import java.io.IOException;
import java.util.Iterator;
/** /**
* Image processing utilities. * Image processing utilities.

View File

@ -1,9 +1,9 @@
package com.sismics.util; package com.sismics.util;
import java.text.MessageFormat;
import org.codehaus.jackson.JsonNode; import org.codehaus.jackson.JsonNode;
import java.text.MessageFormat;
/** /**
* JSON validation utilities. * JSON validation utilities.
* *

View File

@ -1,11 +1,10 @@
package com.sismics.util; 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.constant.Constants;
import com.sismics.docs.core.dao.jpa.LocaleDao; import com.sismics.docs.core.dao.jpa.LocaleDao;
import org.apache.commons.lang.StringUtils;
import java.util.Locale;
/** /**
* Locale utilities. * Locale utilities.

View File

@ -1,5 +1,7 @@
package com.sismics.util; package com.sismics.util;
import com.google.common.collect.Lists;
import java.io.File; import java.io.File;
import java.io.FilenameFilter; import java.io.FilenameFilter;
import java.io.IOException; import java.io.IOException;
@ -7,16 +9,10 @@ import java.net.URISyntaxException;
import java.net.URL; import java.net.URL;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.util.Arrays; import java.util.*;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.jar.JarEntry; import java.util.jar.JarEntry;
import java.util.jar.JarFile; import java.util.jar.JarFile;
import com.google.common.collect.Lists;
/** /**
* Resource utilities. * Resource utilities.
* *

View File

@ -1,21 +1,9 @@
package com.sismics.util.jpa; package com.sismics.util.jpa;
import java.io.File; import com.google.common.base.Strings;
import java.io.FilenameFilter; import com.google.common.io.CharStreams;
import java.io.IOException; import com.sismics.docs.core.util.ConfigUtil;
import java.io.InputStream; import com.sismics.util.ResourceUtil;
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 org.hibernate.HibernateException; import org.hibernate.HibernateException;
import org.hibernate.JDBCException; import org.hibernate.JDBCException;
import org.hibernate.engine.jdbc.internal.FormatStyle; import org.hibernate.engine.jdbc.internal.FormatStyle;
@ -27,10 +15,16 @@ import org.hibernate.tool.hbm2ddl.ConnectionHelper;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import com.google.common.base.Strings; import java.io.*;
import com.google.common.io.CharStreams; import java.sql.Connection;
import com.sismics.docs.core.util.ConfigUtil; import java.sql.ResultSet;
import com.sismics.util.ResourceUtil; 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. * A helper to update the database incrementally.

View File

@ -1,16 +1,6 @@
package com.sismics.util.jpa; package com.sismics.util.jpa;
import java.io.File; import com.sismics.docs.core.util.DirectoryUtil;
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 org.hibernate.cfg.Environment; import org.hibernate.cfg.Environment;
import org.hibernate.internal.util.config.ConfigurationHelper; import org.hibernate.internal.util.config.ConfigurationHelper;
import org.hibernate.service.ServiceRegistry; import org.hibernate.service.ServiceRegistry;
@ -18,7 +8,15 @@ import org.hibernate.service.ServiceRegistryBuilder;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; 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. * Entity manager factory.

View File

@ -25,10 +25,6 @@
package com.sismics.util.jpa; 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.cfg.Environment;
import org.hibernate.engine.jdbc.spi.SqlExceptionHelper; import org.hibernate.engine.jdbc.spi.SqlExceptionHelper;
import org.hibernate.internal.util.config.ConfigurationHelper; 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.service.jdbc.connections.spi.ConnectionProvider;
import org.hibernate.tool.hbm2ddl.ConnectionHelper; 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 * A {@link ConnectionHelper} implementation based on an internally
* built and managed {@link ConnectionProvider}. * built and managed {@link ConnectionProvider}.

View File

@ -25,13 +25,13 @@
package com.sismics.util.jpa; package com.sismics.util.jpa;
import java.sql.Connection;
import java.sql.SQLException;
import org.hibernate.engine.jdbc.spi.SqlExceptionHelper; import org.hibernate.engine.jdbc.spi.SqlExceptionHelper;
import org.hibernate.service.jdbc.connections.spi.ConnectionProvider; import org.hibernate.service.jdbc.connections.spi.ConnectionProvider;
import org.hibernate.tool.hbm2ddl.ConnectionHelper; import org.hibernate.tool.hbm2ddl.ConnectionHelper;
import java.sql.Connection;
import java.sql.SQLException;
/** /**
* A {@link ConnectionHelper} implementation based on a provided * A {@link ConnectionHelper} implementation based on a provided
* {@link ConnectionProvider}. Essentially, ensures that the connection * {@link ConnectionProvider}. Essentially, ensures that the connection

View File

@ -1,18 +1,17 @@
package com.sismics.util.log4j; 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.Iterator;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Queue; import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue; 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. * Memory appender for Log4J.
* *

View File

@ -1,13 +1,12 @@
package com.sismics.docs; 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.context.ThreadLocalContext;
import com.sismics.util.jpa.EMF; 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. * Base class of tests with a transactional context.

View File

@ -1,13 +1,10 @@
package com.sismics.docs.core.dao.jpa; package com.sismics.docs.core.dao.jpa;
import junit.framework.Assert;
import org.junit.Test;
import com.sismics.docs.BaseTransactionalTest; 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.model.jpa.User;
import com.sismics.docs.core.util.TransactionUtil; import com.sismics.docs.core.util.TransactionUtil;
import junit.framework.Assert;
import org.junit.Test;
/** /**
* Tests the persistance layer. * Tests the persistance layer.

View File

@ -1,7 +1,6 @@
package com.sismics.util; package com.sismics.util;
import junit.framework.Assert; import junit.framework.Assert;
import org.junit.Test; import org.junit.Test;
/** /**

View File

@ -1,11 +1,10 @@
package com.sismics.util; package com.sismics.util;
import java.util.List;
import junit.framework.Assert; import junit.framework.Assert;
import org.junit.Test; import org.junit.Test;
import java.util.List;
/** /**
* Test of the resource utils. * Test of the resource utils.
* *

View File

@ -1,15 +1,15 @@
package com.sismics.rest.exception; 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.JSONException;
import org.codehaus.jettison.json.JSONObject; import org.codehaus.jettison.json.JSONObject;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; 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). * Jersey exception encapsulating an error from the client (BAD_REQUEST).
* *

View File

@ -1,12 +1,12 @@
package com.sismics.rest.exception; 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.WebApplicationException;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status; 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. * Unauthorized access to the resource exception.
* *

View File

@ -1,14 +1,14 @@
package com.sismics.rest.exception; 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.WebApplicationException;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status; 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). * Jersey exception encapsulating an error from the client (INTERNAL_SERVER_ERROR).
* *

View File

@ -1,15 +1,15 @@
package com.sismics.rest.resource; 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.JSONException;
import org.codehaus.jettison.json.JSONObject; import org.codehaus.jettison.json.JSONObject;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; 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. * Generic exception mapper that transforms all unknown exception into ServerError.
* *

View File

@ -1,19 +1,18 @@
package com.sismics.rest.util; 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.google.common.base.Strings;
import com.sismics.docs.core.dao.file.theme.ThemeDao; import com.sismics.docs.core.dao.file.theme.ThemeDao;
import com.sismics.docs.core.dao.jpa.LocaleDao; import com.sismics.docs.core.dao.jpa.LocaleDao;
import com.sismics.docs.core.model.jpa.Locale; import com.sismics.docs.core.model.jpa.Locale;
import com.sismics.rest.exception.ClientException; 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. * Utility class to validate parameters.

View File

@ -1,9 +1,9 @@
package com.sismics.security; package com.sismics.security;
import java.util.Locale;
import org.joda.time.DateTimeZone; import org.joda.time.DateTimeZone;
import java.util.Locale;
/** /**
* Anonymous principal. * Anonymous principal.
* *

View File

@ -1,10 +1,10 @@
package com.sismics.security; package com.sismics.security;
import org.joda.time.DateTimeZone;
import java.security.Principal; import java.security.Principal;
import java.util.Locale; import java.util.Locale;
import org.joda.time.DateTimeZone;
/** /**
* Interface of principals. * Interface of principals.
* *

View File

@ -1,10 +1,10 @@
package com.sismics.security; package com.sismics.security;
import org.joda.time.DateTimeZone;
import java.util.Locale; import java.util.Locale;
import java.util.Set; import java.util.Set;
import org.joda.time.DateTimeZone;
/** /**
* Authenticated users principal. * Authenticated users principal.
* *

View File

@ -1,26 +1,5 @@
package com.sismics.util.filter; 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.constant.Constants;
import com.sismics.docs.core.model.context.AppContext; import com.sismics.docs.core.model.context.AppContext;
import com.sismics.docs.core.util.DirectoryUtil; 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.EnvironmentUtil;
import com.sismics.util.context.ThreadLocalContext; import com.sismics.util.context.ThreadLocalContext;
import com.sismics.util.jpa.EMF; 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. * Filter used to process a couple things in the request context.

View File

@ -1,24 +1,5 @@
package com.sismics.util.filter; 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.constant.Constants;
import com.sismics.docs.core.dao.jpa.AuthenticationTokenDao; import com.sismics.docs.core.dao.jpa.AuthenticationTokenDao;
import com.sismics.docs.core.dao.jpa.RoleBaseFunctionDao; 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.AnonymousPrincipal;
import com.sismics.security.UserPrincipal; import com.sismics.security.UserPrincipal;
import com.sismics.util.LocaleUtil; 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. * This filter is used to authenticate the user having an active session via an authentication token stored in database.

View File

@ -1,16 +1,8 @@
package com.sismics.docs.rest; package com.sismics.docs.rest;
import java.io.ByteArrayOutputStream; import com.sismics.docs.rest.descriptor.JerseyTestWebAppDescriptorFactory;
import java.io.File; import com.sismics.docs.rest.util.ClientUtil;
import java.io.IOException; import com.sun.jersey.test.framework.JerseyTest;
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 org.glassfish.grizzly.http.server.HttpServer; import org.glassfish.grizzly.http.server.HttpServer;
import org.glassfish.grizzly.http.server.StaticHttpHandler; import org.glassfish.grizzly.http.server.StaticHttpHandler;
import org.junit.After; import org.junit.After;
@ -18,9 +10,15 @@ import org.junit.Before;
import org.subethamail.wiser.Wiser; import org.subethamail.wiser.Wiser;
import org.subethamail.wiser.WiserMessage; import org.subethamail.wiser.WiserMessage;
import com.sismics.docs.rest.descriptor.JerseyTestWebAppDescriptorFactory; import javax.mail.MessagingException;
import com.sismics.docs.rest.util.ClientUtil; import javax.mail.internet.MimeMessage;
import com.sun.jersey.test.framework.JerseyTest; 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. * Base class of integration tests with Jersey.

View File

@ -1,11 +1,11 @@
package com.sismics.docs.rest.descriptor; package com.sismics.docs.rest.descriptor;
import java.io.File;
import com.sismics.util.filter.RequestContextFilter; import com.sismics.util.filter.RequestContextFilter;
import com.sismics.util.filter.TokenBasedSecurityFilter; import com.sismics.util.filter.TokenBasedSecurityFilter;
import com.sun.jersey.test.framework.WebAppDescriptor; import com.sun.jersey.test.framework.WebAppDescriptor;
import java.io.File;
/** /**
* Jersey tests Webapp descriptor. * Jersey tests Webapp descriptor.
* *

View File

@ -1,16 +1,15 @@
package com.sismics.docs.rest.filter; 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.sismics.util.filter.TokenBasedSecurityFilter;
import com.sun.jersey.api.client.ClientHandlerException; import com.sun.jersey.api.client.ClientHandlerException;
import com.sun.jersey.api.client.ClientRequest; import com.sun.jersey.api.client.ClientRequest;
import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.filter.ClientFilter; 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. * Filter to add the authentication token into a cookie.
* *

View File

@ -1,16 +1,15 @@
package com.sismics.docs.rest.util; 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.docs.rest.filter.CookieAuthenticationFilter;
import com.sismics.util.filter.TokenBasedSecurityFilter; import com.sismics.util.filter.TokenBasedSecurityFilter;
import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.ClientResponse.Status; import com.sun.jersey.api.client.ClientResponse.Status;
import com.sun.jersey.api.client.WebResource; import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.core.util.MultivaluedMapImpl; 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. * REST client utilities.

View File

@ -1,11 +1,9 @@
package com.sismics.docs.rest.util; package com.sismics.docs.rest.util;
import junit.framework.Assert;
import org.junit.Test;
import com.sismics.rest.exception.ClientException; import com.sismics.rest.exception.ClientException;
import com.sismics.rest.util.ValidationUtil; import com.sismics.rest.util.ValidationUtil;
import junit.framework.Assert;
import org.junit.Test;
/** /**
* Test the validations. * Test the validations.

View File

@ -10,5 +10,5 @@ public enum BaseFunction {
/** /**
* Allows the user to use the admin fonctions. * Allows the user to use the admin fonctions.
*/ */
ADMIN, ADMIN
} }

View File

@ -1,22 +1,5 @@
package com.sismics.docs.rest.resource; 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.DocumentDao;
import com.sismics.docs.core.dao.jpa.criteria.DocumentCriteria; import com.sismics.docs.core.dao.jpa.criteria.DocumentCriteria;
import com.sismics.docs.core.dao.jpa.dto.DocumentDto; 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.LogCriteria;
import com.sismics.util.log4j.LogEntry; import com.sismics.util.log4j.LogEntry;
import com.sismics.util.log4j.MemoryAppender; 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. * General app REST resource.

View File

@ -1,19 +1,17 @@
package com.sismics.docs.rest.resource; 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.docs.rest.constant.BaseFunction;
import com.sismics.rest.exception.ForbiddenClientException; import com.sismics.rest.exception.ForbiddenClientException;
import com.sismics.security.IPrincipal; import com.sismics.security.IPrincipal;
import com.sismics.security.UserPrincipal; import com.sismics.security.UserPrincipal;
import com.sismics.util.filter.TokenBasedSecurityFilter; 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. * Base class of REST resources.

View File

@ -1,29 +1,5 @@
package com.sismics.docs.rest.resource; 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.google.common.base.Strings;
import com.sismics.docs.core.dao.jpa.DocumentDao; import com.sismics.docs.core.dao.jpa.DocumentDao;
import com.sismics.docs.core.dao.jpa.TagDao; 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.ClientException;
import com.sismics.rest.exception.ForbiddenClientException; import com.sismics.rest.exception.ForbiddenClientException;
import com.sismics.rest.util.ValidationUtil; 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. * Document REST resources.

View File

@ -1,31 +1,5 @@
package com.sismics.docs.rest.resource; 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.DocumentDao;
import com.sismics.docs.core.dao.jpa.FileDao; import com.sismics.docs.core.dao.jpa.FileDao;
import com.sismics.docs.core.model.jpa.Document; 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.sismics.util.mime.MimeTypeUtil;
import com.sun.jersey.multipart.FormDataBodyPart; import com.sun.jersey.multipart.FormDataBodyPart;
import com.sun.jersey.multipart.FormDataParam; 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. * File REST resources.

View File

@ -1,19 +1,17 @@
package com.sismics.docs.rest.resource; package com.sismics.docs.rest.resource;
import java.util.ArrayList; import com.sismics.docs.core.dao.jpa.LocaleDao;
import java.util.List; 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.GET;
import javax.ws.rs.Path; import javax.ws.rs.Path;
import javax.ws.rs.Produces; import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import java.util.ArrayList;
import org.codehaus.jettison.json.JSONException; import java.util.List;
import org.codehaus.jettison.json.JSONObject;
import com.sismics.docs.core.dao.jpa.LocaleDao;
import com.sismics.docs.core.model.jpa.Locale;
/** /**
* Locale REST resources. * Locale REST resources.

View File

@ -1,30 +1,21 @@
package com.sismics.docs.rest.resource; 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.TagDao;
import com.sismics.docs.core.dao.jpa.dto.TagStatDto; import com.sismics.docs.core.dao.jpa.dto.TagStatDto;
import com.sismics.docs.core.model.jpa.Tag; import com.sismics.docs.core.model.jpa.Tag;
import com.sismics.rest.exception.ClientException; import com.sismics.rest.exception.ClientException;
import com.sismics.rest.exception.ForbiddenClientException; import com.sismics.rest.exception.ForbiddenClientException;
import com.sismics.rest.util.ValidationUtil; 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. * Tag REST resources.

View File

@ -1,10 +1,8 @@
package com.sismics.docs.rest.resource; package com.sismics.docs.rest.resource;
import java.io.IOException; import com.sun.jersey.core.util.ReaderWriter;
import java.io.OutputStream; import org.codehaus.jettison.json.JSONException;
import java.io.OutputStreamWriter; import org.codehaus.jettison.json.JSONObject;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import javax.ws.rs.Produces; import javax.ws.rs.Produces;
import javax.ws.rs.WebApplicationException; 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.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyWriter; import javax.ws.rs.ext.MessageBodyWriter;
import javax.ws.rs.ext.Provider; import javax.ws.rs.ext.Provider;
import java.io.IOException;
import org.codehaus.jettison.json.JSONException; import java.io.OutputStream;
import org.codehaus.jettison.json.JSONObject; import java.io.OutputStreamWriter;
import java.lang.annotation.Annotation;
import com.sun.jersey.core.util.ReaderWriter; import java.lang.reflect.Type;
/** /**
* MessageBodyWriter personalized to write JSON despite the text/plain MIME type. * MessageBodyWriter personalized to write JSON despite the text/plain MIME type.

View File

@ -1,18 +1,16 @@
package com.sismics.docs.rest.resource; package com.sismics.docs.rest.resource;
import java.util.ArrayList; import com.sismics.docs.core.dao.file.theme.ThemeDao;
import java.util.List; import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;
import javax.ws.rs.GET; import javax.ws.rs.GET;
import javax.ws.rs.Path; import javax.ws.rs.Path;
import javax.ws.rs.Produces; import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import java.util.ArrayList;
import org.codehaus.jettison.json.JSONException; import java.util.List;
import org.codehaus.jettison.json.JSONObject;
import com.sismics.docs.core.dao.file.theme.ThemeDao;
/** /**
* Theme REST resources. * Theme REST resources.

View File

@ -1,29 +1,5 @@
package com.sismics.docs.rest.resource; 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.constant.Constants;
import com.sismics.docs.core.dao.jpa.AuthenticationTokenDao; import com.sismics.docs.core.dao.jpa.AuthenticationTokenDao;
import com.sismics.docs.core.dao.jpa.RoleBaseFunctionDao; 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.security.UserPrincipal;
import com.sismics.util.LocaleUtil; import com.sismics.util.LocaleUtil;
import com.sismics.util.filter.TokenBasedSecurityFilter; 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. * User REST resources.

View File

@ -1,17 +1,14 @@
package com.sismics.docs.rest; 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.sismics.docs.rest.filter.CookieAuthenticationFilter;
import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.ClientResponse.Status; import com.sun.jersey.api.client.ClientResponse.Status;
import com.sun.jersey.api.client.WebResource; 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. * Test the app resource.

View File

@ -1,20 +1,18 @@
package com.sismics.docs.rest; 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.sismics.docs.rest.filter.CookieAuthenticationFilter;
import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.ClientResponse.Status; import com.sun.jersey.api.client.ClientResponse.Status;
import com.sun.jersey.api.client.WebResource; import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.core.util.MultivaluedMapImpl; 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. * Exhaustive test of the document resource.

View File

@ -1,16 +1,5 @@
package com.sismics.docs.rest; 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.google.common.io.ByteStreams;
import com.sismics.docs.rest.filter.CookieAuthenticationFilter; import com.sismics.docs.rest.filter.CookieAuthenticationFilter;
import com.sismics.util.mime.MimeType; 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.core.util.MultivaluedMapImpl;
import com.sun.jersey.multipart.FormDataBodyPart; import com.sun.jersey.multipart.FormDataBodyPart;
import com.sun.jersey.multipart.FormDataMultiPart; 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. * Exhaustive test of the document resource.

View File

@ -1,17 +1,14 @@
package com.sismics.docs.rest; 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 junit.framework.Assert;
import org.codehaus.jettison.json.JSONArray; import org.codehaus.jettison.json.JSONArray;
import org.codehaus.jettison.json.JSONException; import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject; import org.codehaus.jettison.json.JSONObject;
import org.junit.Test; 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. * Test the locale resource.
* *

View File

@ -1,18 +1,15 @@
package com.sismics.docs.rest; 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.sismics.docs.rest.filter.CookieAuthenticationFilter;
import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.ClientResponse.Status; import com.sun.jersey.api.client.ClientResponse.Status;
import com.sun.jersey.api.client.WebResource; import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.core.util.MultivaluedMapImpl; 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. * Test of the security layer.

View File

@ -1,17 +1,15 @@
package com.sismics.docs.rest; 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.sismics.docs.rest.filter.CookieAuthenticationFilter;
import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.ClientResponse.Status; import com.sun.jersey.api.client.ClientResponse.Status;
import com.sun.jersey.api.client.WebResource; import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.core.util.MultivaluedMapImpl; 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. * Test the tag resource.

View File

@ -1,17 +1,14 @@
package com.sismics.docs.rest; 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 junit.framework.Assert;
import org.codehaus.jettison.json.JSONArray; import org.codehaus.jettison.json.JSONArray;
import org.codehaus.jettison.json.JSONException; import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject; import org.codehaus.jettison.json.JSONObject;
import org.junit.Test; 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. * Test the theme resource.
* *

View File

@ -1,22 +1,18 @@
package com.sismics.docs.rest; 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.sismics.docs.rest.filter.CookieAuthenticationFilter;
import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.ClientResponse.Status; import com.sun.jersey.api.client.ClientResponse.Status;
import com.sun.jersey.api.client.WebResource; import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.core.util.MultivaluedMapImpl; 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. * Exhaustive test of the user resource.