protected void doHandleTargetedRequest ( final Request request ) { // Check for file id String fileId = request . getParameter ( FILE_UPLOAD_ID_KEY ) ; if ( fileId == null ) { throw new SystemException ( "No file id provided for content request." ) ; } // Check valid file id FileWidgetUpload file = getFile ( fileId ) ; if ( file == null ) { throw new SystemException ( "Invalid file id [" + fileId + "]." ) ; } // Check if thumb nail requested boolean thumbNail = request . getParameter ( FILE_UPLOAD_THUMB_NAIL_KEY ) != null ; if ( thumbNail ) { doHandleThumbnailRequest ( file ) ; } else { doHandleFileContentRequest ( file ) ; } }
Handle a targeted request . Can be a file upload thumbnail request or file content request .