View Javadoc

1   /*
2    * $Header: /cvsroot/sinon/sinon/src/java/eteg/sinon/exception/UnsuccesfulPageDownloadException.java,v 1.2 2005/06/21 14:25:08 thiagohp Exp $
3    * $Revision: 1.2 $
4    * $Date: 2005/06/21 14:25:08 $
5    * $Author: thiagohp $
6    *
7    * =============================================================================
8    *
9    * Copyright 2004-2005 Eteg Internet Ltda. (http://www.eteg.com.br)
10   *
11   * Licensed under the Apache License, Version 2.0 (the "License");
12   * you may not use this file except in compliance with the License.
13   * You may obtain a copy of the License at
14   *
15   *     http://www.apache.org/licenses/LICENSE-2.0
16   *
17   * Unless required by applicable law or agreed to in writing, software
18   * distributed under the License is distributed on an "AS IS" BASIS,
19   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20   * See the License for the specific language governing permissions and
21   * limitations under the License.
22   */
23  package eteg.sinon.exception;
24  
25  import eteg.sinon.executor.CollectorExecutor;
26  
27  /***
28   * Exceção levantada quando não se consegue fazer o download de uma página com
29   * sucesso. A resposta HTTP é um inteiro retornado pelo servidor como resposta
30   * a uma requisição.
31   * <a href="http://www.w3.org/Protocols/HTTP/HTRESP.html">Esta página</a>
32   * contém uma descrição das respostas mais freqüentes. O valor -1 pode ser
33   * retornado. Isto é uma indicação de erro no uso do
34   * <a href="http://jakarta.apache.org/commons/httpclient/">HttpClient</a>,
35   * componente utilizado para fazer o download de páginas Web.
36   *
37   * @author <a href="mailto:thiagohp at users.sourceforge.net">Thiago H. de Paula Figueiredo</a>
38   * @author Last modified by $Author: thiagohp $
39   * @version $Revision: 1.2 $
40   * @since 0.0
41   */
42  public class UnsuccesfulPageDownloadException extends SinonException {
43  
44      /***
45       * Resposta HTTP.
46       */
47      private int httpResponse;
48  
49      public UnsuccesfulPageDownloadException(String message,
50                                              int httpResponse,
51                                              CollectorExecutor executor) {
52          super(message, executor);
53          this.httpResponse = httpResponse;
54      }
55  
56      /***
57       * Retorna a resposta HTTP.
58       *
59       * @return um <code>int</code> contendo a resposta HTTP.
60       */
61      public int getHttpResponse() {
62          return httpResponse;
63      }
64  
65  }