|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wjhk.jupload2.policies.DefaultUploadPolicy
public class DefaultUploadPolicy
This class implements all UploadPolicy
methods. Its way of working is he same as the JUpload version 1.
The simplest way to use this policy is given in the presentation of
UploadPolicy
. The DefaultUploadPolicy is used when no
uploadPolicy parameter is given to the juploadContext, or this
parameter has 'DefaultUploadPolicy' as a value.
The default behavior is representated below. It can be overridden by
adding parameters to the juploadContext. All available parameters are shown
in the presentation of UploadPolicy
.
UploadPolicy
methods.
Field Summary | |
---|---|
protected String |
cookie
cookie is the value of the javascript document.cookie property. |
protected File |
debugFile
The actual file, used for the debug log. |
protected boolean |
debugOk
This flag prevents endless repeats of opening the debug log, if that failed for some reason. |
protected PrintStream |
debugOut
This stream is used to store all information that could be useful, in case a problem occurs. |
protected Pattern |
patternError
Same as patternSuccess , but for the error message. |
protected Pattern |
patternSuccess
The regexp pattern that is used to find the success string in the HTTP response. |
protected Pattern |
patternWarning
Same as patternSuccess , but for the warning message. |
protected String |
userAgent
userAgent is the value of the javascript navigator.userAgent property. |
Constructor Summary | |
---|---|
DefaultUploadPolicy(wjhk.jupload2.context.JUploadContext juploadContext)
The main constructor : use default values, and the given postURL. |
Method Summary | |
---|---|
void |
addComponentsToJUploadPanel(JUploadPanel jUploadPanel)
This methods allow the upload policy to override the default disposition of the components on the applet. |
void |
addHeader(String header)
Add an header to the list of headers that will be added to each HTTP upload request. |
protected void |
addMsgToDebugLog(String msg)
This methods allows the applet to store all messages (debug, warning, info, errors...) into a StringBuffer. |
void |
afterFileDropped(DropTargetDropEvent dropEvent)
Default reaction after a successful drop operation: no action. |
void |
afterUpload(Exception e,
String serverOutput)
This method is called after an upload, whether it is successful or not. |
void |
alert(String key)
alert displays a MessageBox with a unique 'Ok' button, like the javascript alert function. |
void |
alertStr(String str)
alert displays a MessageBox with a unique 'Ok' button, like the javascript alert function. |
boolean |
beforeUpload()
Execute any action, that must be done before upload. |
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. |
JUploadFileChooser |
createFileChooser()
Default implementation for UploadPolicy.createFileChooser() : just
a creation of a JUploadFileChooser . |
FileData |
createFileData(File file,
File root)
The DefaultUpload accepts all file types: we just return an instance of FileData, without any test. |
JPanel |
createProgressPanel(JProgressBar preparationProgressBar,
JProgressBar uploadProgressBar,
JButton uploadButton,
JButton stopButton,
JPanel mainPanel)
This method is called to create the progress panel. |
JPanel |
createStatusBar(JLabel content,
JPanel mainPanel)
This method is used to create a new status bar. |
JPanel |
createTopPanel(JButton browse,
JButton remove,
JButton removeAll,
JUploadPanel jUploadPanel)
Default implementation of UploadPolicy.createTopPanel(JButton, JButton, JButton, JUploadPanel)
. |
void |
deleteLog()
Delete the current log. |
void |
displayDebug(String debug,
int minDebugLevel)
log a debug message. |
void |
displayErr(Exception e)
log an error message, based on an exception. |
void |
displayErr(String err)
log an error message. |
void |
displayErr(String errorText,
Exception exception)
If debug is off, the log window may not be visible. |
void |
displayInfo(String info)
log an info message. |
void |
displayParameterStatus()
This method displays the applet parameter list, according to the current debugLevel. |
void |
displayWarn(String warn)
log a warning message. |
boolean |
fileFilterAccept(File file)
This method returns the response for the JUploadFileFilter.accept(File) which just calls this method. |
String |
fileFilterGetDescription()
Return a description for the FileFilter, according to the current upload policy. |
Icon |
fileViewGetIcon(File file)
Returns null: the default icon is used. |
String |
getAfterUploadTarget()
Return the target, specified as applet parameter "afterUploadTarget" |
String |
getAfterUploadURL()
Retrieves the current value for the afterUploadURL applet parameter. |
String |
getAllowedFileExtensions()
Retrieves the current value for allowedFileExtensions * |
boolean |
getAllowHttpPersistent()
Retrieves the current value for allowHttpPersistent |
wjhk.jupload2.context.JUploadContext |
getContext()
A useful function, that has nothing to do with an upload policy. |
File |
getCurrentBrowsingDirectory()
Returns the current browsing directory, that is: the directory that will be current the next time the file chooser is opened. |
String |
getDateFormat()
Returns the currently choosen format for date. |
int |
getDebugLevel()
This method returns the current debug level. |
protected String |
getEncodedFilename(String filename)
returns the filename and encodes it, if necessary |
int |
getFileChooserIconFromFileContent()
Getter for fileChooserIconFromFileContent. |
int |
getFileChooserIconSize()
Getter for fileChooserIconSize. |
String |
getFilenameEncoding()
Returns the encoding that should be used for the filename. |
String |
getFormdata()
Retrieve the applet's "formdata" parameter. |
boolean |
getFtpCreateDirectoryStructure()
Returns the current value for the ftpCreateDirectoryStructure applet parameter. |
boolean |
getFtpTransfertBinary()
Returns the current value for the ftpTransfertBinary applet parameter. |
boolean |
getFtpTransfertPassive()
Returns the current value for the ftpTransfertPassive applet parameter. |
String |
getHttpUploadParameterName()
Retrieve the applet's "httpUploadParameterName" parameter. |
String |
getHttpUploadParameterType()
Retrieve the applet's "httpUploadParameterType" parameter. |
JUploadException |
getLastException()
Indicates that an error occurs. |
String |
getLastResponseBody()
Retrieve the body of the last server response. |
String |
getLastResponseMessage()
Retrieve the status/error message of the last server response. |
protected String |
getLookAndFeel()
|
long |
getMaxChunkSize()
Returns the value of the applet parameter maxChunkSize (see above for a description of all applet parameters) |
long |
getMaxFileSize()
Returns the value of the applet parameter maxFileSize (see above for a description of all applet parameters) |
int |
getNbFilesPerRequest()
This function returns the number of files should be uploaded during one access to the server. |
String |
getPostURL()
Get the target URL for upload. |
boolean |
getReadCookieFromNavigator()
Return the current value of readCookieFromNavigator |
String |
getServerProtocol()
HTTP protocol that should be used to send the HTTP request. |
String |
getShowLogWindow()
Indicate whether the log window should be shown. |
String |
getSpecificHeaders()
Returns the list of specific headers, that will be added to all HTTP request to the server. |
int |
getSslVerifyCert()
Retrieves SSL verification mode. |
String |
getString(String key)
Retrieve a local property. |
String |
getStringUploadError()
Retrieve the regular expression that will be tested against each line of the server answer. |
String |
getStringUploadSuccess()
Get the regular expression that will be tested against each line of the server answer. |
String |
getStringUploadWarning()
Retrieve the regular expression that will be tested against each line of the server answer. |
String |
getUploadFilename(FileData fileData,
int index)
Get the original name of the file on the disk. |
String |
getUploadName(FileData fileData,
int index)
Get an upload filename, that is to be send in the HTTP upload request. |
String |
getUrlToSendErrorTo()
Returns the current URL where error log must be posted. |
wjhk.jupload2.upload.helper.ByteArrayEncoder |
onAppendHeader(wjhk.jupload2.upload.helper.ByteArrayEncoder bae)
Append specific headers for this upload (session cookies, for instance). |
void |
onFileDoubleClicked(FileData fileData)
Default implementation of the UploadPolicy.onFileDoubleClicked(FileData)
. |
void |
onFileSelected(FileData fileData)
Default implementation of the UploadPolicy.onFileSelected(wjhk.jupload2.filedata.FileData)
. |
void |
sendDebugInformation(String description,
Exception exception)
This method allows the applet to post debug information to the website (see UploadPolicy.getUrlToSendErrorTo() ). |
protected void |
setAfterUploadURL(String afterUploadURL)
Set the afterUploadURL |
protected void |
setAllowedFileExtensions(String allowedFileExtensions)
|
protected void |
setAllowHttpPersistent(boolean value)
|
void |
setCurrentBrowsingDirectory(File currentBrowsingDirectoryParam)
Set the current directory. |
void |
setCurrentBrowsingDirectory(String currentBrowsingDirectoryParam)
Set the current directory. |
Cursor |
setCursor(Cursor cursor)
Changes the current mouse cursor. |
void |
setDebugLevel(int debugLevel)
This method indicate whether or not the debug messages must be displayed. |
void |
setDebugLevel(int debugLevel,
boolean displayAppletParameterList)
Set the debug level. |
void |
setFileChooserIconFromFileContent(int fileChooserIconFromFileContent)
Setter for fileChooserIconFromFileContent. |
void |
setFileChooserIconSize(int fileChooserIconSize)
Setter for fileChooserIconSize. |
protected void |
setFilenameEncoding(String filenameEncoding)
|
protected void |
setFtpCreateDirectoryStructure(boolean ftpCreateDirectoryStructure)
|
protected void |
setFtpTransfertBinary(boolean ftpTransfertBinary)
|
protected void |
setFtpTransfertPassive(boolean ftpTransfertPassive)
|
void |
setLang(String lang)
This method sets the current language to take into account. |
void |
setLastException(JUploadException exception)
Set the last exception. |
protected void |
setLookAndFeel(String lookAndFeel)
|
protected void |
setMaxChunkSize(long maxChunkSize)
|
protected void |
setMaxFileSize(long maxFileSize)
|
protected void |
setNbFilesPerRequest(int nbFilesPerRequest)
|
void |
setPostURL(String postURL)
The URL can change during the life of our policy ... |
void |
setProperty(String prop,
String value)
This method manages all applet parameters. |
protected void |
setServerProtocol(String value)
|
void |
setShowLogWindow(String showLogWindow)
|
protected void |
setShowStatusbar(boolean show)
|
protected void |
setSpecificHeaders(String specificHeaders)
Set all specific headers defined in the specificHeaders applet parameter. |
protected void |
setSslVerifyCert(String mode)
|
protected void |
setStringUploadError(String stringUploadError)
|
protected void |
setStringUploadSuccess(String stringUploadSuccess)
|
protected void |
setStringUploadWarning(String stringUploadWarning)
|
void |
setUrlToSendErrorTo(String urlToSendErrorTo)
|
Cursor |
setWaitCursor()
This method changes the current mouse cursor to the wait one. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected PrintStream debugOut
protected File debugFile
debugGenerateFile
protected boolean debugOk
protected String cookie
protected String userAgent
protected Pattern patternError
patternSuccess
, but for the error message. If found,
then the upload was accepted by the remote HTTP server, but rejected by
the remote application. This pattern should also find the error message
in the first matching string.
protected Pattern patternSuccess
protected Pattern patternWarning
patternSuccess
, but for the warning message. Each time
it is found, a message is displayed to the user.
Constructor Detail |
---|
public DefaultUploadPolicy(wjhk.jupload2.context.JUploadContext juploadContext) throws JUploadException
juploadContext
- The current juploadContext. As the reference to the
current upload policy exists almost everywhere, this parameter
allows any access to anyone on the juploadContext... including
reading the applet parameters.
JUploadException
- If an applet parameter is invalidMethod Detail |
---|
public void addHeader(String header)
UploadPolicy
DefaultUploadPolicy
.
addHeader
in interface UploadPolicy
UploadPolicy.addHeader(java.lang.String)
public boolean checkUploadSuccess(int status, String msg, String body) throws JUploadException
DefaultUploadPolicy
) 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 UploadPolicy
status
- 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.UploadPolicy.checkUploadSuccess(int, String, String)
public void afterUpload(Exception e, String serverOutput) throws JUploadException
UploadPolicy
afterUpload
in interface UploadPolicy
e
- null if success, or the exception indicating the problem.serverOutput
- The full server output, including the HTTP headers.
JUploadException
UploadPolicy.afterUpload(Exception, String)
public void alertStr(String str)
UploadPolicy
alertStr
in interface UploadPolicy
str
- The full String that must be displayed to the user.UploadPolicy.alertStr(String)
public void alert(String key)
UploadPolicy
alert
in interface UploadPolicy
key
- The string identifying the text to display, depending on the
current language.UploadPolicy.alert(String)
public FileData createFileData(File file, File root) throws JUploadExceptionStopAddingFiles
createFileData
in interface UploadPolicy
file
- The file used to create the FileData instance. This method is
called once for each file selected by the user, even if the
user added several files in one 'shot'.root
- An optional toplevel directory of a hierarchy (can be null).
PictureUploadPolicy.createFileData(File,File)
for an
example. It's up to the upload policy to display a message to
inform the user that this file won't be added to the file list.
JUploadExceptionStopAddingFiles
- The exception is not really an
error. It allows an easy way to indicates that the applet
should stop adding files when the user clicked on the
'Cancel' button.UploadPolicy.createFileData(File, File)
public JPanel createTopPanel(JButton browse, JButton remove, JButton removeAll, JUploadPanel jUploadPanel)
UploadPolicy.createTopPanel(JButton, JButton, JButton, JUploadPanel)
. IT creates a JPanel, containing the three given JButton. It creates the
same panel as the original JUpload.
createTopPanel
in interface UploadPolicy
browse
- The default browse button.remove
- The default removeSelected button.removeAll
- The default removeAll button.jUploadPanel
- The panel that contains all objects.
UploadPolicy.createTopPanel(JButton, JButton,
JButton, JUploadPanel)
public JPanel createProgressPanel(JProgressBar preparationProgressBar, JProgressBar uploadProgressBar, JButton uploadButton, JButton stopButton, JPanel mainPanel)
UploadPolicy
createProgressPanel(JProgressBar, JProgressBar, JButton, JButton, JPanel)
.
createProgressPanel
in interface UploadPolicy
preparationProgressBar
- The default preparation progress bar.uploadProgressBar
- The default upload progress bar.uploadButton
- The default upload button.stopButton
- The default stop button.mainPanel
- The panel that contains all objects.
UploadPolicy.createProgressPanel(JProgressBar,
JProgressBar, JButton, JButton, JPanel)
public JPanel createStatusBar(JLabel content, JPanel mainPanel)
UploadPolicy
createStatusBar(JLabel, JPanel)
.
createStatusBar
in interface UploadPolicy
content
- The status bar contentmainPanel
- The panel that contains all objects.
UploadPolicy.createStatusBar(javax.swing.JLabel,
javax.swing.JPanel)
public void addComponentsToJUploadPanel(JUploadPanel jUploadPanel)
addComponentsToJUploadPanel
in interface UploadPolicy
jUploadPanel
- The main applet panel.UploadPolicy.addComponentsToJUploadPanel(JUploadPanel)
public void displayErr(Exception e)
UploadPolicy
displayErr
in interface UploadPolicy
e
- The exception to reportUploadPolicy.displayErr(Exception)
public void displayErr(String err)
UploadPolicy
displayErr
in interface UploadPolicy
err
- The erreur message to be displayed.UploadPolicy.displayErr(String)
public void displayErr(String errorText, Exception exception)
displayErr
in interface UploadPolicy
errorText
- The error message to be displayed.exception
- An exception. It's stacktrace is logged.UploadPolicy.displayErr(java.lang.String,
java.lang.Exception)
public void displayInfo(String info)
UploadPolicy
displayInfo
in interface UploadPolicy
info
- The information message that will be displayed.UploadPolicy.displayInfo(String)
public void displayWarn(String warn)
UploadPolicy
displayWarn
in interface UploadPolicy
warn
- The warning message that will be displayed.UploadPolicy.displayWarn(String)
public void displayDebug(String debug, int minDebugLevel)
UploadPolicy
displayDebug
in interface UploadPolicy
debug
- The message to display.minDebugLevel
- If the current debug level is superior or equals to
minDebugLevel, the message will be displayed. Otherwise, it
will be ignored.UploadPolicy.displayDebug(String, int)
public String getString(String key)
UploadPolicy
getString
in interface UploadPolicy
key
- The key, whose associated text is to retrieve.
UploadPolicy.getString(String)
public String getUploadFilename(FileData fileData, int index) throws JUploadException
UploadPolicy
getUploadFilename
in interface UploadPolicy
fileData
- The file data whose upload file name must be calculated.index
- index of the file in the current request to the server (from
0 to n)
JUploadException
UploadPolicy.getUploadFilename(FileData, int)
protected final String getEncodedFilename(String filename) throws JUploadException
filename
- the original filename
JUploadException
public String getUploadName(FileData fileData, int index) throws JUploadException
UploadPolicy
UploadPolicy
, the value
for this parameter is controled by the applet parameters:
targetPictureFormat and keepOriginalFileExtensionForConvertedImages.
getUploadName
in interface UploadPolicy
fileData
- The file data whose upload name must be calculated.index
- index of the file in the current request to the server (from
0 to n)
JUploadException
UploadPolicy.getUploadName(FileData, int)
public String getHttpUploadParameterName()
UploadPolicy
getHttpUploadParameterName
in interface UploadPolicy
UploadPolicy.getHttpUploadParameterName()
public String getHttpUploadParameterType()
UploadPolicy
getHttpUploadParameterType
in interface UploadPolicy
UploadPolicy.getHttpUploadParameterType()
public boolean beforeUpload()
UploadPolicy
PictureUploadPolicy
disable the rotation buttons during buttons.
The beforeUpload()
method just returns true.
beforeUpload
in interface UploadPolicy
UploadPolicy.beforeUpload()
public wjhk.jupload2.upload.helper.ByteArrayEncoder onAppendHeader(wjhk.jupload2.upload.helper.ByteArrayEncoder bae) throws JUploadIOException
UploadPolicy
onAppendHeader
in interface UploadPolicy
bae
- The header ByteArrayEncoder
where specific headers
should be appended.
ByteArrayEncoder
given in parameters. This is allows
to work like with StringBuffer.append method:
sb.append(s1).append(s2);
JUploadIOException
UploadPolicy.onAppendHeader(ByteArrayEncoder)
public void onFileSelected(FileData fileData)
UploadPolicy.onFileSelected(wjhk.jupload2.filedata.FileData)
. Nothing's done.
onFileSelected
in interface UploadPolicy
public void onFileDoubleClicked(FileData fileData)
UploadPolicy.onFileDoubleClicked(FileData)
. Nothing's done.
onFileDoubleClicked
in interface UploadPolicy
public void sendDebugInformation(String description, Exception exception)
UploadPolicy
UploadPolicy.getUrlToSendErrorTo()
). Then, it is possible to log the
error, to send a mail...
sendDebugInformation
in interface UploadPolicy
description
- A string describing briefly the problem. The mail subject
will be something like: Jupload Error (reason)exception
- The java exception that was raised, or null if no
exception.UploadPolicy.sendDebugInformation(String, Exception)
public void setProperty(String prop, String value) throws JUploadException
setProperty
in interface UploadPolicy
prop
- The applet parameter name.value
- The new value for this parameter. If the value is not valid
(for instance aaa for a number), a warning is displayed
in the log window, and the existing value is not changed.
JUploadException
JUploadExceptionStopAddingFiles
- 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 void displayParameterStatus()
setDebugLevel(int)
method. It
should be override by any subclasses, that should display its own
parameters, then call super.displayParameterStatus().
displayParameterStatus
in interface UploadPolicy
UploadPolicy.displayParameterStatus()
public String getAfterUploadURL()
UploadPolicy
getAfterUploadURL
in interface UploadPolicy
UploadPolicy.getAfterUploadURL()
protected void setAfterUploadURL(String afterUploadURL) throws JUploadException
afterUploadURL
afterUploadURL
- The URL to use.
JUploadException
public boolean getAllowHttpPersistent()
UploadPolicy
getAllowHttpPersistent
in interface UploadPolicy
UploadPolicy.getAllowHttpPersistent()
public String getAllowedFileExtensions()
UploadPolicy
getAllowedFileExtensions
in interface UploadPolicy
UploadPolicy.getAllowedFileExtensions()
protected void setAllowedFileExtensions(String allowedFileExtensions)
allowedFileExtensions
- the allowedFileExtensions to setprotected void setAllowHttpPersistent(boolean value)
public wjhk.jupload2.context.JUploadContext getContext()
UploadPolicy
getContext
in interface UploadPolicy
UploadPolicy.getContext()
public void setCurrentBrowsingDirectory(File currentBrowsingDirectoryParam)
setCurrentBrowsingDirectory
in interface UploadPolicy
currentBrowsingDirectoryParam
- The directory that will be the
current one, the next time the file chooser is opened.UploadPolicy.getCurrentBrowsingDirectory()
public void setCurrentBrowsingDirectory(String currentBrowsingDirectoryParam)
UploadPolicy
setCurrentBrowsingDirectory
in interface UploadPolicy
currentBrowsingDirectoryParam
- The name of the directory that
should be the current one.UploadPolicy.setCurrentBrowsingDirectory(String)
public File getCurrentBrowsingDirectory()
UploadPolicy
getCurrentBrowsingDirectory
in interface UploadPolicy
UploadPolicy.getCurrentBrowsingDirectory()
public String getDateFormat()
UploadPolicy
getDateFormat
in interface UploadPolicy
UploadPolicy.getDateFormat()
public int getDebugLevel()
UploadPolicy
getDebugLevel
in interface UploadPolicy
UploadPolicy.getDebugLevel()
public void setDebugLevel(int debugLevel)
UploadPolicy
DefaultUploadPolicy
.addMsgToDebugBufferString method stores all
debug output in a BufferString.
setDebugLevel
in interface UploadPolicy
debugLevel
- The new debugLevel.UploadPolicy.setDebugLevel(int)
public void setDebugLevel(int debugLevel, boolean displayAppletParameterList)
debugLevel
- The new debuglevel.displayAppletParameterList
- Flag. If set to true, the applet's
parameters are shown.public int getFileChooserIconFromFileContent()
getFileChooserIconFromFileContent
in interface UploadPolicy
UploadPolicy.PROP_FILE_CHOOSER_ICON_FROM_FILE_CONTENT
public void setFileChooserIconFromFileContent(int fileChooserIconFromFileContent)
fileChooserIconFromFileContent
- Value to be set. If the value is
not allowed (not -1, 0 or 1), the current value is unchangeed.UploadPolicy.PROP_FILE_CHOOSER_ICON_FROM_FILE_CONTENT
public int getFileChooserIconSize()
getFileChooserIconSize
in interface UploadPolicy
UploadPolicy.PROP_FILE_CHOOSER_ICON_SIZE
public void setFileChooserIconSize(int fileChooserIconSize)
fileChooserIconSize
- Value to be set.UploadPolicy.PROP_FILE_CHOOSER_ICON_SIZE
public void setLang(String lang)
UploadPolicy
setLang
in interface UploadPolicy
lang
- The new language to take into account. See the
java.util.Locale(String) constructor for a list of valid
values.UploadPolicy.setLang(String)
protected String getLookAndFeel()
protected void setLookAndFeel(String lookAndFeel)
lookAndFeel
- the lookAndFeel to setpublic long getMaxChunkSize()
UploadPolicy
getMaxChunkSize
in interface UploadPolicy
UploadPolicy.getMaxChunkSize()
protected void setMaxChunkSize(long maxChunkSize)
maxChunkSize
- the maxChunkSize to setpublic long getMaxFileSize()
UploadPolicy
getMaxFileSize
in interface UploadPolicy
UploadPolicy.getMaxFileSize()
protected void setMaxFileSize(long maxFileSize)
maxFileSize
- the maxFileSize to setpublic int getNbFilesPerRequest()
UploadPolicy
getNbFilesPerRequest
in interface UploadPolicy
UploadPolicy.getNbFilesPerRequest()
protected void setNbFilesPerRequest(int nbFilesPerRequest) throws JUploadException
nbFilesPerRequest
- the nbFilesPerRequest to set
JUploadException
public String getFilenameEncoding()
UploadPolicy
getFilenameEncoding
in interface UploadPolicy
UploadPolicy.getFilenameEncoding()
protected void setFilenameEncoding(String filenameEncoding)
filenameEncoding
- the filenameEncoding to setpublic boolean getFtpCreateDirectoryStructure()
UploadPolicy
getFtpCreateDirectoryStructure
in interface UploadPolicy
UploadPolicy.getFtpCreateDirectoryStructure()
protected void setFtpCreateDirectoryStructure(boolean ftpCreateDirectoryStructure)
ftpCreateDirectoryStructure
- the ftpCreateDirectoryStructure to setpublic boolean getFtpTransfertBinary()
UploadPolicy
getFtpTransfertBinary
in interface UploadPolicy
UploadPolicy.getFtpTransfertBinary()
protected void setFtpTransfertBinary(boolean ftpTransfertBinary)
ftpTransfertBinary
- the ftpTransfertBinary to setpublic boolean getFtpTransfertPassive()
UploadPolicy
getFtpTransfertPassive
in interface UploadPolicy
UploadPolicy.getFtpTransfertPassive()
protected void setFtpTransfertPassive(boolean ftpTransfertPassive)
ftpTransfertPassive
- the ftpTransfertPassive to setpublic String getPostURL()
UploadPolicy
getPostURL
in interface UploadPolicy
UploadPolicy.getPostURL()
public void setPostURL(String postURL) throws JUploadException
UploadPolicy
setPostURL
in interface UploadPolicy
JUploadException
UploadPolicy.setPostURL(String)
public boolean getReadCookieFromNavigator()
UploadPolicy
getReadCookieFromNavigator
in interface UploadPolicy
UploadPolicy.getReadCookieFromNavigator()
public String getServerProtocol()
UploadPolicy
CoppermineUploadPolicy
, as the coppermine
control that the protocol used for each HTTP request is the same as the
one used during the session creation. It is used in the default policy,
as it could be used elsewhere.
getServerProtocol
in interface UploadPolicy
UploadPolicy.getServerProtocol()
protected void setServerProtocol(String value) throws JUploadException
value
- the serverProtocol to set
JUploadException
public String getShowLogWindow()
UploadPolicy
getShowLogWindow
in interface UploadPolicy
UploadPolicy.getShowLogWindow()
public void setShowLogWindow(String showLogWindow)
setShowLogWindow
in interface UploadPolicy
showLogWindow
- The show window status to set.UploadPolicy.getShowLogWindow()
public String getSpecificHeaders()
UploadPolicy
getSpecificHeaders
in interface UploadPolicy
UploadPolicy.getSpecificHeaders()
protected void setSpecificHeaders(String specificHeaders)
specificHeaders
- public int getSslVerifyCert()
UploadPolicy
getSslVerifyCert
in interface UploadPolicy
UploadPolicy.getSslVerifyCert()
protected void setSslVerifyCert(String mode) throws JUploadException
JUploadException
protected void setShowStatusbar(boolean show)
show
- the new showStatusbar valuepublic String getStringUploadError()
UploadPolicy
getStringUploadError
in interface UploadPolicy
UploadPolicy.getStringUploadError()
public String getStringUploadSuccess()
UploadPolicy
getStringUploadSuccess
in interface UploadPolicy
UploadPolicy.getStringUploadSuccess()
public String getStringUploadWarning()
UploadPolicy
getStringUploadWarning
in interface UploadPolicy
UploadPolicy.getStringUploadWarning()
protected void setStringUploadError(String stringUploadError) throws JUploadException
stringUploadError
- the stringUploadError to set
JUploadException
protected void setStringUploadSuccess(String stringUploadSuccess) throws JUploadException
stringUploadSuccess
- the stringUploadSuccess to set
JUploadException
protected void setStringUploadWarning(String stringUploadWarning) throws JUploadException
stringUploadWarning
- the stringUploadWarning to set
JUploadException
public String getUrlToSendErrorTo()
UploadPolicy
getUrlToSendErrorTo
in interface UploadPolicy
UploadPolicy.getUrlToSendErrorTo()
public void setUrlToSendErrorTo(String urlToSendErrorTo) throws JUploadException
setUrlToSendErrorTo
in interface UploadPolicy
urlToSendErrorTo
- the urlToSendErrorTo to set
JUploadException
public String getFormdata()
UploadPolicy
getFormdata
in interface UploadPolicy
UploadPolicy.getFormdata()
public String getAfterUploadTarget()
UploadPolicy
getAfterUploadTarget
in interface UploadPolicy
UploadPolicy.getAfterUploadTarget()
public void deleteLog()
protected void addMsgToDebugLog(String msg)
msg
- public void afterFileDropped(DropTargetDropEvent dropEvent)
afterFileDropped
in interface UploadPolicy
dropEvent
- The event containing the dropped fileUploadPolicy.afterFileDropped(DropTargetDropEvent)
public JUploadFileChooser createFileChooser()
UploadPolicy.createFileChooser()
: just
a creation of a JUploadFileChooser
.
createFileChooser
in interface UploadPolicy
UploadPolicy.createFileChooser()
public boolean fileFilterAccept(File file)
JUploadFileFilter.accept(File)
which just calls this method. This
method checks that the file extension corresponds to the
allowedFileExtensions applet parameter.
fileFilterAccept
in interface UploadPolicy
file
- Allows the applet to filter files from the file chooser.
UploadPolicy.fileFilterAccept(File)
public String fileFilterGetDescription()
UploadPolicy
fileFilterGetDescription
in interface UploadPolicy
UploadPolicy.fileFilterGetDescription()
public Icon fileViewGetIcon(File file)
fileViewGetIcon
in interface UploadPolicy
file
- The file from which the icon should represent.
UploadPolicy.fileViewGetIcon(File)
public JUploadException getLastException()
UploadPolicy
getLastException
in interface UploadPolicy
UploadPolicy.getLastException()
public void setLastException(JUploadException exception)
exception
- The last exception that occurs into the applet.public String getLastResponseBody()
UploadPolicy
getLastResponseBody
in interface UploadPolicy
UploadPolicy.getLastResponseBody()
public String getLastResponseMessage()
UploadPolicy
getLastResponseMessage
in interface UploadPolicy
UploadPolicy.getLastResponseMessage()
public Cursor setCursor(Cursor cursor)
UploadPolicy
UploadPolicy.setWaitCursor()
.
setCursor
in interface UploadPolicy
cursor
- The cursor that must be set.
UploadPolicy.setCursor(Cursor)
public Cursor setWaitCursor()
UploadPolicy
setWaitCursor
in interface UploadPolicy
UploadPolicy.setWaitCursor()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |