This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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.