Ignore:
Timestamp:
Feb 28, 2011, 7:40:53 PM (13 years ago)
Author:
mlg
Message:

Modifications to handle proxy error.
Two types of error are handled : proxy address error and proxy authentication error.
Connecting to jiwigo via a proxy seems to work (tried with my own server... gonna have to try with an external server).
version is 0.13.1.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/jiwigo-ws-api/src/main/java/fr/mael/jiwigo/dao/CommentDao.java

    r9392 r9430  
    1010import fr.mael.jiwigo.om.Comment;
    1111import fr.mael.jiwigo.transverse.enumeration.MethodsEnum;
     12import fr.mael.jiwigo.transverse.exception.ProxyAuthenticationException;
    1213import fr.mael.jiwigo.transverse.session.SessionManager;
    1314import fr.mael.jiwigo.transverse.util.Tools;
     
    8081     * @return list of comments
    8182     * @throws IOException
     83     * @throws ProxyAuthenticationException
    8284     */
    83     public List<Comment> list(Integer idImage) throws IOException {
     85    public List<Comment> list(Integer idImage) throws IOException, ProxyAuthenticationException {
    8486        Document doc = (sessionManager.executeReturnDocument(MethodsEnum.GET_INFO.getLabel(), "image_id", String
    85                 .valueOf(idImage)));
     87                .valueOf(idImage), "comments_per_page", "100"));
    8688        Element element = doc.getRootElement().getChild("image").getChild("comments");
    8789        List<Element> listElement = (List<Element>) element.getChildren("comment");
     
    103105     * @return the key
    104106     * @throws IOException
     107     * @throws ProxyAuthenticationException
    105108     */
    106     public String getKey(Integer idImage) throws IOException {
     109    public String getKey(Integer idImage) throws IOException, ProxyAuthenticationException {
    107110        Document doc = (sessionManager.executeReturnDocument(MethodsEnum.GET_INFO.getLabel(), "image_id", String
    108111                .valueOf(idImage)));
     
    116119     * @return true if the comment is successfully added
    117120     * @throws IOException
     121     * @throws ProxyAuthenticationException
    118122     */
    119     public boolean create(Comment commentaire) throws IOException {
     123    public boolean create(Comment commentaire) throws IOException, ProxyAuthenticationException {
    120124        String key = getKey(commentaire.getImageId());
    121125        try {
Note: See TracChangeset for help on using the changeset viewer.