public class CoppermineUploadPolicy extends PictureUploadPolicy
debugFile, debugOk, debugOut, DIALOG_MESSAGE_MAX_LINE_LENGTH, httpUploadParameterName, httpUploadParameterType, lastResponseMessage, patternError, patternSuccess, patternWarningABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHDEFAULT_AFTER_UPLOAD_TARGET, DEFAULT_AFTER_UPLOAD_URL, DEFAULT_ALBUM_ID, DEFAULT_ALLOW_HTTP_PERSISTENT, DEFAULT_ALLOWED_FILE_EXTENSIONS, DEFAULT_BROWSING_DIRECTORY, DEFAULT_DATE_FORMAT, DEFAULT_DEBUG_LEVEL, DEFAULT_FILE_CHOOSER_ICON_FROM_FILE_CONTENT, DEFAULT_FILE_CHOOSER_ICON_SIZE, DEFAULT_FILE_CHOOSER_IMAGE_PREVIEW, DEFAULT_FILE_FILTER_NAME, DEFAULT_FILE_LIST_VIEW_MODE, DEFAULT_FILENAME_ENCODING, DEFAULT_FORMDATA, DEFAULT_FTP_CREATE_DIRECTORY_STRUCTURE, DEFAULT_FTP_TRANSFERT_BINARY, DEFAULT_FTP_TRANSFERT_PASSIVE, DEFAULT_HIGH_QUALITY_PREVIEW, DEFAULT_HTTP_UPLOAD_PARAMETER_NAME, DEFAULT_HTTP_UPLOAD_PARAMETER_TYPE, DEFAULT_KEEP_ORIG_EXTENSION, DEFAULT_LANG, DEFAULT_LOOK_AND_FEEL, DEFAULT_MAX_CHUNK_SIZE, DEFAULT_MAX_FILE_SIZE, DEFAULT_MAX_HEIGHT, DEFAULT_MAX_WIDTH, DEFAULT_NB_FILES_PER_REQUEST, DEFAULT_PICTURE_COMPRESSION_QUALITY, DEFAULT_PICTURE_TRANSMIT_METADATA, DEFAULT_POST_URL, DEFAULT_READ_COOKIE_FROM_NAVIGATOR, DEFAULT_READ_USER_AGENT_FROM_NAVIGATOR, DEFAULT_REAL_MAX_HEIGHT, DEFAULT_REAL_MAX_WIDTH, DEFAULT_RETRY_MAX_NUMBER_OF, DEFAULT_RETRY_NB_SECONDS_BETWEEN, DEFAULT_SEND_MD5_SUM, DEFAULT_SERVER_PROTOCOL, DEFAULT_SHOW_LOGWINDOW, DEFAULT_SHOW_STATUSBAR, DEFAULT_SPECIFIC_HEADERS, DEFAULT_SSL_VERIFY_CERT, DEFAULT_STORE_BUFFERED_IMAGE, DEFAULT_STRING_UPLOAD_ERROR, DEFAULT_STRING_UPLOAD_SUCCESS, DEFAULT_STRING_UPLOAD_WARNING, DEFAULT_TARGET_PICTURE_FORMAT, DEFAULT_UPLOAD_POLICY, DEFAULT_URL_TO_SEND_ERROR_TO, EXEC_STATUS_READY, EXEC_STATUS_UPLOADING, HTTPUPLOADPARAMETERTYPE_ARRAY, HTTPUPLOADPARAMETERTYPE_ITERATION, HTTPUPLOADPARAMETERTYPE_ONE_FILE, PROP_AFTER_UPLOAD_TARGET, PROP_AFTER_UPLOAD_URL, PROP_ALBUM_ID, PROP_ALLOW_HTTP_PERSISTENT, PROP_ALLOWED_FILE_EXTENSIONS, PROP_BROWSING_DIRECTORY, PROP_DEBUG_LEVEL, PROP_FILE_CHOOSER_ICON_FROM_FILE_CONTENT, PROP_FILE_CHOOSER_ICON_SIZE, PROP_FILE_CHOOSER_IMAGE_PREVIEW, PROP_FILE_FILTER_NAME, PROP_FILE_LIST_VIEW_MODE, PROP_FILENAME_ENCODING, PROP_FORMDATA, PROP_FTP_CREATE_DIRECTORY_STRUCTURE, PROP_FTP_TRANSFERT_BINARY, PROP_FTP_TRANSFERT_PASSIVE, PROP_HIGH_QUALITY_PREVIEW, PROP_HTTP_UPLOAD_PARAMETER_NAME, PROP_HTTP_UPLOAD_PARAMETER_TYPE, PROP_KEEP_ORIG_EXTENSION, PROP_LANG, PROP_LOOK_AND_FEEL, PROP_MAX_CHUNK_SIZE, PROP_MAX_FILE_SIZE, PROP_MAX_HEIGHT, PROP_MAX_WIDTH, PROP_NB_FILES_PER_REQUEST, PROP_PICTURE_COMPRESSION_QUALITY, PROP_PICTURE_TRANSMIT_METADATA, PROP_POST_URL, PROP_READ_COOKIE_FROM_NAVIGATOR, PROP_READ_USER_AGENT_FROM_NAVIGATOR, PROP_REAL_MAX_HEIGHT, PROP_REAL_MAX_WIDTH, PROP_RETRY_MAX_NUMBER_OF, PROP_RETRY_NB_SECONDS_BETWEEN, PROP_SEND_MD5_SUM, PROP_SERVER_PROTOCOL, PROP_SHOW_LOGWINDOW, PROP_SHOW_STATUSBAR, PROP_SPECIFIC_HEADERS, PROP_SSL_VERIFY_CERT, PROP_STORE_BUFFERED_IMAGE, PROP_STRING_UPLOAD_ERROR, PROP_STRING_UPLOAD_SUCCESS, PROP_STRING_UPLOAD_WARNING, PROP_TARGET_PICTURE_FORMAT, PROP_UPLOAD_POLICY, PROP_URL_TO_SEND_ERROR_TO, SHOWLOGWINDOW_FALSE, SHOWLOGWINDOW_ONERROR, SHOWLOGWINDOW_TRUE| Constructor and Description |
|---|
CoppermineUploadPolicy(JUploadContext juploadContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterUpload(Exception e,
String serverOutput)
This method is called after an upload, whether it is successful or not.
|
boolean |
beforeUpload()
This method checks that an album id has been given, and then stores the
number of files that are to be uploaded, before upload, then call its
superclass.
|
boolean |
checkUploadSuccess(int status,
String msg,
String body)
The default behavior (see
DefaultUploadPolicy) is to check that the stringUploadSuccess applet parameter
is present in the response from the server. |
void |
displayParameterStatus()
This method displays the applet parameter list, according to the current debugLevel.
|
String |
getPostURL()
Get the target URL for upload.
|
void |
onFileSelected(FileData fileData)
Default implementation of the
UploadPolicy.onFileSelected(wjhk.jupload2.filedata.FileData) . |
void |
setProperty(String prop,
String value)
This method only handles the albumId parameter, which is the only
applet parameter that is specific to this class.
|
actionPerformed, createFileChooser, createFileData, createTopPanel, fileViewGetIcon, getFileChooserImagePreview, getHighQualityPreview, getImageFileConversionInfo, getKeepOrigExtension, getMaxHeight, getMaxWidth, getPictureCompressionQuality, getPictureTransmitMetadata, getRealMaxHeight, getRealMaxWidth, getTargetPictureFormat, getUploadFilename, imageUpdate, onFileDoubleClicked, setCursor, setFileChooserImagePreview, setWaitCursoraddComponentsToJUploadPanel, addHeader, addMsgToDebugLog, afterFileDropped, alert, alertStr, confirmDialogStr, createProgressPanel, createStatusBar, deleteLog, displayDebug, displayErr, displayErr, displayErr, displayErr, displayInfo, displayWarn, fileFilterAccept, fileFilterGetDescription, formatMessage, getAfterUploadTarget, getAfterUploadURL, getAllowedFileExtensions, getAllowHttpPersistent, getContext, getCurrentBrowsingDirectory, getDateFormat, getDebugLevel, getEncodedFilename, getFileChooserIconFromFileContent, getFileChooserIconSize, getFileFilterName, getFileListViewMode, getFilenameEncoding, getFormdata, getFtpCreateDirectoryStructure, getFtpTransfertBinary, getFtpTransfertPassive, getHttpUploadParameterName, getHttpUploadParameterType, getLastException, getLastResponseBody, getLastResponseMessage, getLocale, getLocalizedString, getLookAndFeel, getMaxChunkSize, getMaxFileSize, getNbFilesPerRequest, getReadCookieFromNavigator, getReadUserAgentFromNavigator, getRetryMaxNumberOf, getRetryNbSecondsBetween, getSendMD5Sum, getServerProtocol, getShowLogWindow, getSpecificHeaders, getSslVerifyCert, getStringUploadError, getStringUploadSuccess, getStringUploadWarning, getUploadName, getUrlToSendErrorTo, onAppendHeader, sendDebugInformation, setAfterUploadURL, setAllowedFileExtensions, setAllowHttpPersistent, setCurrentBrowsingDirectory, setCurrentBrowsingDirectory, setDebugLevel, setDebugLevel, setFileChooserIconFromFileContent, setFileChooserIconSize, setFileFilterName, setFileListViewMode, setFilenameEncoding, setFtpCreateDirectoryStructure, setFtpTransfertBinary, setFtpTransfertPassive, setHttpUploadParameterName, setHttpUploadParameterType, setLang, setLastException, setLookAndFeel, setMaxChunkSize, setMaxFileSize, setNbFilesPerRequest, setPostURL, setReadCookieFromNavigator, setReadUserAgentFromNavigator, setRetryMaxNumberOf, setRetryNbSecondsBetween, setSendMD5Sum, setServerProtocol, setShowLogWindow, setShowStatusbar, setSpecificHeaders, setSslVerifyCert, setStringUploadError, setStringUploadSuccess, setStringUploadWarning, setUrlToSendErrorTo, start, updateButtonStatepublic CoppermineUploadPolicy(JUploadContext juploadContext) throws JUploadException
juploadContext - Identifier for the current applet. It's necessary, to read
information from the navigator.JUploadExceptionpublic void onFileSelected(FileData fileData)
DefaultUploadPolicyUploadPolicy.onFileSelected(wjhk.jupload2.filedata.FileData) . Nothing's done.onFileSelected in interface UploadPolicyonFileSelected in class PictureUploadPolicyUploadPolicy.onFileSelected(wjhk.jupload2.filedata.FileData)public void setProperty(String prop, String value) throws JUploadException
setProperty in interface UploadPolicysetProperty in class PictureUploadPolicyprop - The property which value should changevalue - The new value for this property. If invalid, the default value is used.JUploadExceptionJUploadExceptionStopAddingFiles - indicates that the applet should stop strying adding the current file
selection. Useful for instance, when a user drop a directory, full of unallowed file: it's
annoying for the user to click 'Ok' for each file in the alert box.UploadPolicy.setProperty(java.lang.String,
java.lang.String)public String getPostURL()
UploadPolicygetPostURL in interface UploadPolicygetPostURL in class DefaultUploadPolicyUploadPolicy.getPostURL()public boolean beforeUpload()
beforeUpload in interface UploadPolicybeforeUpload in class PictureUploadPolicyUploadPolicy.beforeUpload()public void afterUpload(Exception e, String serverOutput) throws JUploadException
UploadPolicyafterUpload in interface UploadPolicyafterUpload in class DefaultUploadPolicye - null if success, or the exception indicating the problem.serverOutput - The full server output, including the HTTP headers.JUploadExceptionUploadPolicy.afterUpload(Exception, String)public boolean checkUploadSuccess(int status,
String msg,
String body)
throws JUploadException
DefaultUploadPolicyDefaultUploadPolicy) is to check that the stringUploadSuccess applet parameter
is present in the response from the server. The return is tested, in the order below: checkUploadSuccess in interface UploadPolicycheckUploadSuccess in class DefaultUploadPolicystatus - The HTTP response codemsg - The status message from the first line of the response (e.g. "200 OK").body - The body of the HTTP answer.JUploadException - Thrown if the success conditions are not met.DefaultUploadPolicy.checkUploadSuccess(int, String, String)public void displayParameterStatus()
DefaultUploadPolicyDefaultUploadPolicy.setDebugLevel(int) method. It should be override by any subclasses, that should display its own
parameters, then call super.displayParameterStatus().displayParameterStatus in interface UploadPolicydisplayParameterStatus in class PictureUploadPolicyDefaultUploadPolicy.displayParameterStatus()Copyright © 2015. All rights reserved.