Ignore:
Timestamp:
Apr 20, 2011, 5:17:02 AM (13 years ago)
Author:
anthony43
Message:

huge refactoring to introduce JiwigoException : a generic exception encapsulating low level exceptions (IOException, ProxyAuthentication, etc...)
The aim is to have, on the consumer side, just one exception to catch them all.
this refactoring may need a code review to check the changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/service/impl/ImageServiceImpl.java

    r10494 r10505  
    1313import fr.mael.jiwigo.service.ImageService;
    1414import fr.mael.jiwigo.transverse.exception.FileAlreadyExistsException;
     15import fr.mael.jiwigo.transverse.exception.JiwigoException;
    1516import fr.mael.jiwigo.transverse.exception.ProxyAuthenticationException;
    1617import fr.mael.jiwigo.transverse.exception.WrongChunkSizeException;
     
    5152     * @throws ProxyAuthenticationException
    5253     */
    53     public List<Image> listByCategory(Integer categoryId, boolean rafraichir) throws IOException,
    54             ProxyAuthenticationException {
     54    public List<Image> listByCategory(Integer categoryId, boolean rafraichir) throws JiwigoException {
    5555        return dao.listByCategory(categoryId, rafraichir);
    5656    }
     
    6868     * @throws FileAlreadyExistsException
    6969     * @throws NoSuchAlgorithmException
     70     * @throws JiwigoException
    7071     * @throws Exception
    7172     */
    7273    public boolean create(String filePath, Integer idCategory, Integer originalWidth, Integer originalHeight,
    7374            Double chunckSize, Integer privacyLevel) throws IOException, NoSuchAlgorithmException,
    74             FileAlreadyExistsException, ProxyAuthenticationException, WrongChunkSizeException {
     75            FileAlreadyExistsException, ProxyAuthenticationException, WrongChunkSizeException,
     76            JiwigoException {
    7577        File originalFile = new File(filePath);
    7678        //get the byte array of the original file, to keep metadata
     
    117119     * @throws ProxyAuthenticationException
    118120     */
    119     public boolean addTags(Image image, String tagId) throws IOException, ProxyAuthenticationException {
     121    public boolean addTags(Image image, String tagId) throws JiwigoException {
    120122        return dao.addTags(image.getIdentifier(), tagId);
    121123    }
     
    128130     * @throws ProxyAuthenticationException
    129131     */
    130     public List<Image> search(String queryString) throws IOException, ProxyAuthenticationException {
     132    public List<Image> search(String queryString) throws JiwigoException {
    131133        return dao.search(queryString);
    132134    }
     
    144146    }
    145147
    146     public void addSimple(File file, Integer category, String title) throws IOException {
     148    public void addSimple(File file, Integer category, String title) throws JiwigoException {
    147149        dao.addSimple(file, category, title);
    148150
Note: See TracChangeset for help on using the changeset viewer.