Skip to content

Commit

Permalink
Fix for Issue #3: Add support for retrieving all cookies in HttpTrans…
Browse files Browse the repository at this point in the history
…port

Added a new method getCookies() in HttpTransport and corresponding implementation in hc3.
  • Loading branch information
shanti committed Nov 13, 2012
1 parent 5ec166d commit 0cef3b5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions driver/src/com/sun/faban/driver/HttpTransport.java
Expand Up @@ -23,6 +23,8 @@
*/
package com.sun.faban.driver;

import org.apache.commons.httpclient.Cookie;

import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
Expand Down Expand Up @@ -699,6 +701,14 @@ public String[] getCookieValuesByName(String name) {
return delegate.getCookieValuesByName(name);
}

/**
* Obtains the list of all cookies
* @return array of Cookie objects
*/
public Cookie[] getCookies() {
return delegate.getCookies();
}

/**
* Obtains the header fields of the last request's response.
* @param name The response header field of interest
Expand Down
Expand Up @@ -1443,6 +1443,14 @@ public String[] getCookieValuesByName(String name) {
return valueSet.toArray(values);
}

/**
* Returns all the cookies
* @return array of Cookie objects
*/
public Cookie[] getCookies() {
return hc.getState().getCookies();
}

/**
* Obtains the header fields of the last request's response.
* @param name The response header field of interest
Expand Down

0 comments on commit 0cef3b5

Please sign in to comment.