LWJGL - Drawing to a file.

Hey:)

As a brief side note before I say anything, I wasn’t too sure as to where I should place this topic? If it’s in the wrong place, feel free to move it:P

Anyway, I’m making a game in LWJGL which will include the ability to create your own custom levels and share them with other people.

I’ve created a java server, to receive uploaded data and spit it back out to the right clients. However, I would like the ability to add a thumbnail to the custom games people have made. This thumbnail is going to be a screenshot from inside the level.

Now, see, I don’t want to render the level on the client, save a screenshot then send that to the server for two reasons: Increased bandwidth usage (Which I think will be the bottleneck for server capacity), and the fact that people could rewrite the server to send any image they wanted. Last thing i want is a thousand levels displayed as male genitalia:P

So, what I want to do, is take the data of the level that I send to the server, and render it directly to an image file. I am unsure of how to do this server-side however, because when I eventually buy a server, it’ll be headless, so I think an exception will be thrown if I try to open a Display?

To be fair, I’m not too sure, but anyone’s input would be greatly appreciated:P

Thanks:)

EDIT:
I guess I could draw it with java2D onto a BufferedImage and save that instead? It’d be tricky to replicate the drawing though I guess!