01: /*
02: * ChainBuilder ESB
03: * Visual Enterprise Integration
04: *
05: * Copyright (C) 2007 Bostech Corporation
06: *
07: * This program is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU General Public License as published by the
09: * Free Software Foundation; either version 2 of the License, or (at your option)
10: * any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15: * for more details.
16: *
17: * You should have received a copy of the GNU General Public License along with
18: * this program; if not, write to the Free Software Foundation, Inc.,
19: * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20: *
21: *
22: * $Id: HttpContextConfig.java 8702 2007-08-23 21:02:31Z mpreston $
23: */
24: package com.bostechcorp.cbesb.runtime.component.http.server;
25:
26: public class HttpContextConfig {
27:
28: protected String contextPath;
29: protected boolean soap;
30:
31: public HttpContextConfig() {
32:
33: }
34:
35: public HttpContextConfig(String url) {
36: initFromURL(url);
37: }
38:
39: private void initFromURL(String url) {
40: int index = url.indexOf("://") + 3;
41:
42: int index2 = url.indexOf('/', index);
43: if (index2 == -1) {
44: this .contextPath = "/";
45: } else {
46: this .contextPath = url.substring(index2);
47: }
48: if (this .contextPath.endsWith("/")) {
49: this .contextPath = this .contextPath.substring(0,
50: this .contextPath.length() - 1);
51: }
52: }
53:
54: /**
55: * @return the contextPath
56: */
57: public String getContextPath() {
58: return contextPath;
59: }
60:
61: /**
62: * @param contextPath the contextPath to set
63: */
64: public void setContextPath(String contextPath) {
65: this .contextPath = contextPath;
66: }
67:
68: /**
69: * @return the soap
70: */
71: public boolean isSoap() {
72: return soap;
73: }
74:
75: /**
76: * @param soap the soap to set
77: */
78: public void setSoap(boolean soap) {
79: this.soap = soap;
80: }
81:
82: }
|