public static Resource createFile(Objectify ofy, Key<WebdavFolder> parent, String s, InputStream is, Long length, String contentType) throws IOException, ConflictException {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
StreamUtils.readTo(is, bos);
byte[] data = bos.toByteArray();
Key<WebdavFileData> dataKey = ofy.put(new WebdavFileData(data));
WebdavFile wf = new WebdavFile();
wf.setContentType(fixCT(contentType));
wf.setBytes(data.length);
wf.setName(s);