start of new file
[IRC.git] / Robust / src / Benchmarks / Jhttpp2 / Java / OnURLAction.java
1 /* Written and copyright 2001 Benjamin Kohl.
2  * Distributed under the GNU General Public License; see the README file.
3  * This code comes with NO WARRANTY.
4  *
5  * Title:        jHTTPp2: Java HTTP Filter Proxy
6  * Description: An OpenSource HTTP Proxy
7  * Copyright:    Copyright (c) 2001 Benjamin Kohl
8  * @author Benjamin Kohl
9  */
10
11 public class OnURLAction {
12
13   private String customerrortext, desc, httppath, newlocation;
14   private boolean log,block,customtext,http_rq,anotherlocation;
15   public OnURLAction(String desc)
16   {
17     this.desc=desc;
18   }
19   public void denyAccess(String customerrortext)
20   {
21     this.block=true;
22     this.customtext=true;
23     this.customerrortext=customerrortext;
24   }
25   public void denyAccess()
26   {
27     block=true;
28   }
29   public void logAccess()
30   {
31     log=true;
32   }
33   public void anotherLocation(String newlocation)
34   {
35     this.anotherlocation=true;
36     this.newlocation=newlocation;
37   }
38
39   public boolean onAccesssDeny()
40   {
41     return block;
42   }
43   public boolean onAccessLog()
44   {
45     return log;
46   }
47   public boolean onAccessDenyWithCustomText()
48   {
49     return  customtext;
50   }
51   public boolean onAccessSendHTTPRequest()
52   {
53     return http_rq;
54   }
55   public boolean onAccessRedirect()
56   {
57     return this.anotherlocation;
58   }
59   public String newLocation()
60   {
61     return this.newlocation;
62   }
63   public void setHTTPAction(boolean http_rq, String httppath)
64   {
65     this.http_rq=http_rq;
66     this.httppath=httppath;
67   }
68   public String getCustomErrorText()
69   {
70     return customerrortext;
71   }
72   public String getDescription()
73   {
74     return desc;
75   }
76   public String toString()
77   {
78     return desc;
79   }
80
81 }