Redirects starting to work

I have a system that seems to work for redirects. I mostly copied from
http://docs.oracle.com/javase/tutorial/networking/urls/readingURL.html.
It should be clear what’s happening in creating the header, and in the
get method should the header include 301 Redirect. For a reason I don’t
yet understand, this isn’t working for the cat redirect.