private String processFile(FileItemStream fileItem, byte[] data,
Map<String, String> parameters) throws UploadException {
if (!parameters.containsKey(FILE_TYPE_PARAM)) {
if (!parameters.containsKey(IMAGE_UPLOAD_PAGE_ID)) {
throw new UploadException(Messages.get(
"file.type_not_specified"));
}
else {
return processResourceFileCKeditor(fileItem, data,
Long.valueOf(parameters.get(IMAGE_UPLOAD_PAGE_ID)));
}
}
String fileType = parameters.get(FILE_TYPE_PARAM);
if (fileType.equals(FILE_TYPE_RESOURCE)) {
if (!parameters.containsKey(FOLDER_PARAM)) {
throw new UploadException(Messages.get(
"folder.parameter_not_specified"));
}
return processResourceFileJSON(fileItem, data,
getFolder(Long.valueOf(parameters.get(FOLDER_PARAM))));
}