public static File handleURLUpload(String datasetName, String workSpace, String extension, Request request) throws IOException, ConfigurationException {
// Get the dir where to write and create a file there
GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class);
Resource data = loader.get("data");
final File dir = data.dir(); // find or create
return handleURLUpload(datasetName + "." + extension, workSpace, dir, request);
}
/**
* Reads a url from the body of a request, reads the contents of the url and writes it to a file.