log.debug("Entering");
try {
// authenticated client posted a weblog entry
File tempFile = null;
String handle = pathInfo[0];
FileManager fmgr = roller.getFileManager();
UserManager umgr = roller.getUserManager();
Weblog website = umgr.getWebsiteByHandle(handle);
if (!canEdit(website)) {
throw new AtomNotAuthorizedException("Not authorized to edit weblog: " + handle);
}
if (pathInfo.length > 1) {
// Save to temp file
String fileName = createFileName(website,
(slug != null) ? slug : Utilities.replaceNonAlphanumeric(title,' '), contentType);
try {
tempFile = File.createTempFile(fileName, "tmp");
FileOutputStream fos = new FileOutputStream(tempFile);
Utilities.copyInputToOutput(is, fos);
fos.close();
// Parse pathinfo to determine file path
String path = filePathFromPathInfo(pathInfo);
if (path.length() > 0) path = path + File.separator;
FileInputStream fis = new FileInputStream(tempFile);
fmgr.saveFile(website, path + fileName, contentType, tempFile.length(), fis);
fis.close();
ThemeResource resource = fmgr.getFile(website, path + fileName);
log.debug("Exiting");
return createAtomResourceEntry(website, resource);
} catch (FileIOException fie) {