예제 #1
0
 /**
  * Sets the methods supported defined by this AllowHeader.
  *
  * @param methods - the Iterator of Strings defining the methods supported
  *     <p>in this AllowHeader
  * @throws ParseException which signals that an error has been reached
  *     <p>unexpectedly while parsing the Strings defining the methods supported.
  */
 public void setMethods(List<String> methods) throws ParseException {
   ListIterator<String> it = methods.listIterator();
   while (it.hasNext()) {
     Allow allow = new Allow();
     allow.setMethod((String) it.next());
     this.add(allow);
   }
 }
예제 #2
0
  /**
   * Gets an Iterator of all the methods of the AllowHeader. Returns an empty
   *
   * <p>Iterator if no methods are defined in this Allow Header.
   *
   * @return Iterator of String objects each identifing the methods of
   *     <p>AllowHeader.
   */
  public ListIterator<String> getMethods() {

    LinkedList<String> ll = new LinkedList<String>();

    for (Iterator<Allow> it = this.hlist.iterator(); it.hasNext(); ) {
      Allow a = (Allow) it.next();
      ll.add(a.getMethod());
    }

    return ll.listIterator();
  }