From 258a2d936de1395433f80605fad6e0d34639cd2d Mon Sep 17 00:00:00 2001 From: mattinger Date: Tue, 22 Aug 2006 18:47:47 +0000 Subject: git-svn-id: file:///home/sven/projects/JOGL/temp/ant-contrib/svn/ant-contrib-code/trunk/ant-contrib@31 32d7a393-a5a9-423c-abd3-5d954feb1f2f --- .../net/sf/antcontrib/net/httpclient/GetCookieTask.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/java/net/sf/antcontrib') diff --git a/src/java/net/sf/antcontrib/net/httpclient/GetCookieTask.java b/src/java/net/sf/antcontrib/net/httpclient/GetCookieTask.java index 4c456e6..5b658ed 100644 --- a/src/java/net/sf/antcontrib/net/httpclient/GetCookieTask.java +++ b/src/java/net/sf/antcontrib/net/httpclient/GetCookieTask.java @@ -31,10 +31,11 @@ public class GetCookieTask private String fieldSeparator = "/"; private String cookiePolicy = CookiePolicy.DEFAULT; - private String realm; - private int port; - private String path; - private boolean secure; + + private String realm = null; + private int port = 80; + private String path = null; + private boolean secure = false; public void setFieldSeparator(String fieldSeparator) { this.fieldSeparator = fieldSeparator; @@ -65,6 +66,11 @@ public class GetCookieTask } protected void execute(HttpStateType stateType) throws BuildException { + + if (realm == null || path == null) { + throw new BuildException("'realm' and 'path' attributes are required"); + } + HttpState state = stateType.getState(); CookieSpec spec = CookiePolicy.getCookieSpec(cookiePolicy); Cookie cookies[] = state.getCookies(); -- cgit v1.2.3