return document;
}
private static File newFile(String filename, InputStream inputStream)
throws IOException {
File file = new File();
file.setId(Filenames.asId(filename));
file.setTitle(Filenames.asTitle(filename));
file.setLastModified(new Date());
file.setContentType(Filenames.asContentType(filename));
copyStreamToFile(inputStream, file.getFile());
return file;
}