added "blacklist" of attachment MIME types that won't be compressed; a couple
of other minor tweaks
This commit is contained in:
@@ -34,7 +34,7 @@ public class Attachment extends VeniceServlet
|
||||
*--------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
private static Category logger = Category.getInstance(Attachment.class.getName());
|
||||
private static Category logger = Category.getInstance(Attachment.class);
|
||||
|
||||
/*--------------------------------------------------------------------------------
|
||||
* Overrides from class HttpServlet
|
||||
@@ -102,25 +102,44 @@ public class Attachment extends VeniceServlet
|
||||
VeniceEngine engine, UserContext user, RenderData rdat)
|
||||
throws ServletException, IOException, VeniceServletResult
|
||||
{
|
||||
logger.debug("Attachment.doVenicePost: entry");
|
||||
|
||||
// Get target URL for the operation
|
||||
if (mphandler.isFileParam("target"))
|
||||
{ // bogus target URL
|
||||
logger.error("Internal Error: 'target' should be a normal param");
|
||||
return new ErrorBox(null,"Internal Error: 'target' should be a normal param","top");
|
||||
|
||||
} // end if
|
||||
|
||||
String target = mphandler.getValue("target");
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Target URL: " + target);
|
||||
setMyLocation(request,target);
|
||||
|
||||
// also check on file parameter status
|
||||
if (!(mphandler.isFileParam("thefile")))
|
||||
{ // bogus file parameter
|
||||
logger.error("Internal Error: 'thefile' should be a file param");
|
||||
return new ErrorBox(null,"Internal Error: 'thefile' should be a file param",target);
|
||||
|
||||
} // end if
|
||||
|
||||
// get the SIG
|
||||
SIGContext sig = getSIGParameter(mphandler,user,true,"top");
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("SIG param: #" + sig.getSIGID());
|
||||
changeMenuSIG(request,sig);
|
||||
|
||||
// get the conference
|
||||
ConferenceContext conf = getConferenceParameter(mphandler,sig,true,"top");
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Conference param: #" + conf.getConfID());
|
||||
|
||||
// get the message we want to use
|
||||
TopicMessageContext msg = getMessageParameter(mphandler,conf,true,"top");
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Message param: #" + msg.getPostID());
|
||||
|
||||
try
|
||||
{ // attach the data to the message!
|
||||
@@ -130,20 +149,24 @@ public class Attachment extends VeniceServlet
|
||||
} // end try
|
||||
catch (ServletMultipartException smpe)
|
||||
{ // error processing the file parameter data
|
||||
logger.error("Servlet multipart error:",smpe);
|
||||
return new ErrorBox(null,"Internal Error: " + smpe.getMessage(),target);
|
||||
|
||||
} // end catch
|
||||
catch (AccessError ae)
|
||||
{ // access error posting the attachment data
|
||||
logger.error("Access error:",ae);
|
||||
return new ErrorBox("Access Error",ae.getMessage(),target);
|
||||
|
||||
} // end catch
|
||||
catch (DataException de)
|
||||
{ // error storing the attachment in the database
|
||||
logger.error("DataException:",de);
|
||||
return new ErrorBox("Database Error","Database error storing attachment: " + de.getMessage(),target);
|
||||
|
||||
} // end catch
|
||||
|
||||
logger.debug("Attachment.doVenicePost: done!");
|
||||
throw new RedirectResult(target); // get back, get back, get back to where you once belonged
|
||||
|
||||
} // end doVenicePost
|
||||
|
||||
Reference in New Issue
Block a user