HttpServletRequest request,
HttpServletResponse response)
throws Exception {
ActionErrors errors = new ActionErrors();
FolderFormEx theForm = (FolderFormEx)actionForm;
ActionForward fwd = mapping.findForward("importBookmarks.page");
RollerRequest rreq = RollerRequest.getRollerRequest(request);
RollerSession rses = RollerSession.getRollerSession(request);
BookmarkManager bm = RollerFactory.getRoller().getBookmarkManager();
BasePageModel pageModel = new BasePageModel(
"bookmarksImport.title", request, response, mapping);
request.setAttribute("model", pageModel);
WebsiteData website = getWebsite(request);
pageModel.setWebsite(website);
// if user authorized and a file is being uploaded
if (rses.isUserAuthorizedToAuthor(website) && theForm.getBookmarksFile() != null) {
// this line is here for when the input page is upload-utf8.jsp,
// it sets the correct character encoding for the response
String encoding = request.getCharacterEncoding();
if ((encoding != null) && (encoding.equalsIgnoreCase("utf-8"))) {
response.setContentType("text/html; charset=utf-8");
}
boolean writeFile = false;
//retrieve the file representation
FormFile file = theForm.getBookmarksFile();
String data = null;
InputStream stream = null;
try {
//retrieve the file data