1 16 package org.apache.cocoon.environment.mock; 17 18 import org.apache.cocoon.ProcessingException; 19 import java.io.IOException ; 20 21 import org.apache.cocoon.environment.Redirector; 22 23 public class MockRedirector implements Redirector { 24 25 protected boolean hasRedirected = false; 26 27 private String redirect; 28 29 public void redirect(boolean sessionmode, String url) throws IOException , ProcessingException { 30 this.hasRedirected = true; 31 32 redirect = url; 33 } 34 35 public void globalRedirect(boolean sessionmode, String url) throws IOException , ProcessingException { 36 redirect(sessionmode, url); 37 } 38 39 public String getRedirect() { 40 return redirect; 41 } 42 43 public boolean hasRedirected() { 44 return this.hasRedirected; 45 } 46 47 public void reset() { 48 redirect = null; 49 hasRedirected = false; 50 } 51 52 public void sendStatus(int sc) { 53 hasRedirected = true; 54 } 55 } 56 57 | Popular Tags |