Using URLConnection.getLastModified can leave files open. Make sure to explicitly grab the input stream and close it.