This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
It looks like you're calling theoutput.getClass() before you've defined theoutput, so that's never going to work. Marcin's suggestion should fix that - you might as well use a class literal if you can.
One further point - casting the return value to File is unnecessary - the return type is T, so it will already be File in that call.
That's because getClass() returns a Class<?>, without any generic information. The main way to get a Class object with generic information is to use a class literal. Class.getSuperclass and Class.asSubclass return a Class object with some generic information but it still has a wildcard type.