1 16 package org.apache.cocoon.sitemap; 17 18 import org.apache.cocoon.environment.Environment; 19 import org.apache.cocoon.environment.Redirector; 20 import org.apache.cocoon.environment.wrapper.EnvironmentWrapper; 21 22 import java.io.IOException ; 23 24 32 public class SitemapRedirector implements Redirector { 33 private boolean hasRedirected = false; 34 private Environment e; 35 36 39 public SitemapRedirector(Environment e) { 40 this.e = e; 41 } 42 43 46 public void redirect(boolean sessionMode, String url) throws IOException { 47 e.redirect(sessionMode, url); 48 this.hasRedirected = true; 49 } 50 51 public void globalRedirect(boolean sessionMode, String url) throws IOException { 52 if (e instanceof EnvironmentWrapper) { 53 ((EnvironmentWrapper)e).globalRedirect(sessionMode,url); 54 } else { 55 e.redirect(sessionMode, url); 56 } 57 this.hasRedirected = true; 58 } 59 60 public void sendStatus(int sc) { 61 e.setStatus(sc); 62 this.hasRedirected = true; 63 } 64 65 68 public boolean hasRedirected() { 69 return this.hasRedirected; 70 } 71 } 72 | Popular Tags |