@@ -53,16 +53,30 @@ public class WarArchiver
53
53
/**
54
54
* flag set if finding the webxml is to be expected.
55
55
*/
56
- private boolean ignoreWebxml = true ;
56
+ private boolean expectWebXml = true ;
57
57
58
58
/**
59
59
* flag set if the descriptor is added
60
60
*/
61
61
private boolean descriptorAdded ;
62
62
63
- public void setIgnoreWebxml ( boolean ignore )
63
+ /*
64
+ * @deprecated Use setExpectWebXml instead !
65
+ * @param excpectWebXml true if web xml is *expected* from the client
66
+ */
67
+ @ Deprecated
68
+ public void setIgnoreWebxml ( boolean excpectWebXml )
69
+ {
70
+ expectWebXml = excpectWebXml ;
71
+ }
72
+
73
+ /*.
74
+ * Indicates if the client is required to supply web.xml
75
+ * @param excpectWebXml true if web xml is *expected* from the client
76
+ */
77
+ public void setExpectWebXml ( boolean expectWebXml )
64
78
{
65
- ignoreWebxml = ignore ;
79
+ this . expectWebXml = expectWebXml ;
66
80
}
67
81
68
82
public WarArchiver ()
@@ -143,7 +157,7 @@ protected void initZipOutputStream( ZipArchiveOutputStream zOut )
143
157
throws IOException , ArchiverException
144
158
{
145
159
// If no webxml file is specified, it's an error.
146
- if ( ignoreWebxml && deploymentDescriptor == null && !isInUpdateMode () )
160
+ if ( expectWebXml && deploymentDescriptor == null && !isInUpdateMode () )
147
161
{
148
162
throw new ArchiverException ( "webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)" );
149
163
}
@@ -162,7 +176,7 @@ protected void zipFile( ArchiveEntry entry, ZipArchiveOutputStream zOut, String
162
176
// by the "webxml" attribute and in a <fileset> element.
163
177
if ( vPath .equalsIgnoreCase ( "WEB-INF/web.xml" ) )
164
178
{
165
- if ( descriptorAdded || ( ignoreWebxml
179
+ if ( descriptorAdded || ( expectWebXml
166
180
&& ( deploymentDescriptor == null
167
181
|| !ResourceUtils .isCanonicalizedSame ( entry .getResource (), deploymentDescriptor ) ) ) )
168
182
{
@@ -190,7 +204,7 @@ protected void zipFile( ArchiveEntry entry, ZipArchiveOutputStream zOut, String
190
204
protected void cleanUp ()
191
205
{
192
206
descriptorAdded = false ;
193
- ignoreWebxml = true ;
207
+ expectWebXml = true ;
194
208
super .cleanUp ();
195
209
}
196
210
}
0 commit comments