⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uploadpolicy.java

📁 [linux.rar] - 嵌入式linux开发教程
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
     * @see #PROP_FILE_CHOOSER_ICON_SIZE
     */
    public final static int DEFAULT_FILE_CHOOSER_ICON_SIZE = 20;

    /**
     * Default value for applet parameter "fileChooserImagePreview".
     * 
     * @see #PROP_FILE_CHOOSER_IMAGE_PREVIEW
     */
    public final static boolean DEFAULT_FILE_CHOOSER_IMAGE_PREVIEW = true;

    /**
     * Default value for applet parameter "ftpCreateDirectoryStructure".
     * 
     * @see #PROP_FTP_CREATE_DIRECTORY_STRUCTURE
     */
    public final static boolean DEFAULT_FTP_CREATE_DIRECTORY_STRUCTURE = false;

    /** FTP: binary or ascii mode */
    public final static boolean DEFAULT_FTP_TRANSFERT_BINARY = true;

    /** FTP: passive or active mode */
    public final static boolean DEFAULT_FTP_TRANSFERT_PASSIVE = true;

    /** Default value for parameter "lang". */
    public final static String DEFAULT_LANG = null;

    /**
     * Default value for parameter "filenameEncoding". Note: the
     * CoppermineUploadPolicy forces it to "UTF8".
     */
    public final static String DEFAULT_FILENAME_ENCODING = null;

    /** Default value for parameter "highQualityPreview". */
    public final static boolean DEFAULT_HIGH_QUALITY_PREVIEW = false;

    /** Default value for parameter "lookAndFeel". */
    public final static String DEFAULT_LOOK_AND_FEEL = "";

    /** Default value for parameter "maxChunkSize". */
    public final static long DEFAULT_MAX_CHUNK_SIZE = Long.MAX_VALUE;

    /**
     * Default value for parameter "maxFileSize". Take care of this parameter if
     * chunk upload is activated! See comment above.
     */
    public final static long DEFAULT_MAX_FILE_SIZE = Long.MAX_VALUE;

    /** Default value for parameter "maxPicWidth". */
    public final static int DEFAULT_MAX_WIDTH = Integer.MAX_VALUE;

    /** Default value for parameter "maxPicHeight". */
    public final static int DEFAULT_MAX_HEIGHT = Integer.MAX_VALUE;

    /**
     * Default value for parameter "maxPicHeight". Note: the
     * CoppermineUploadPolicy forces it to 1.
     */
    public final static int DEFAULT_NB_FILES_PER_REQUEST = -1;

    /**
     * Default value for parameter "pictureCompressionQuality".
     */
    public final static float DEFAULT_PICTURE_COMPRESSION_QUALITY = (float) 0.8;

    /**
     * Default value for parameter "pictureCompressionQuality".
     */
    public final static boolean DEFAULT_PICTURE_TRANSMIT_METADATA = false;

    /**
     * Default value for parameter "postURL".
     */
    public final static String DEFAULT_POST_URL = null;

    /**
     * Default value for parameter "realMaxPicWidth".
     */
    public final static int DEFAULT_REAL_MAX_WIDTH = Integer.MAX_VALUE;

    /**
     * Default value for parameter "realMaxPicHeight".
     */
    public final static int DEFAULT_REAL_MAX_HEIGHT = Integer.MAX_VALUE;

    /**
     * Default value for parameter "serverProtocol".
     */
    public final static String DEFAULT_SERVER_PROTOCOL = "HTTP/1.1";

    /**
     * Default value for parameter "showLogWindow".
     */
    public final static String DEFAULT_SHOW_LOGWINDOW = "true";

    /**
     * Default value for parameter "showStatusBar".
     */
    public final static boolean DEFAULT_SHOW_STATUSBAR = true;

    /**
     * Default value for parameter "sslVerifyCert"
     */
    public final static String DEFAULT_SPECIFIC_HEADERS = null;

    /**
     * Default value for parameter "sslVerifyCert"
     */
    public final static String DEFAULT_SSL_VERIFY_CERT = "none";

    /**
     * Default value for parameter "stringUploadError".
     * 
     * @since 2.9.2rc4
     */
    public final static String DEFAULT_STRING_UPLOAD_ERROR = "^ERROR: (.*)$";

    /**
     * Default value for parameter "stringUploadSuccess". Note: was ".* 200 OK$"
     * before 2.9.0
     */
    public final static String DEFAULT_STRING_UPLOAD_SUCCESS = "^SUCCESS$";

    /**
     * Default value for parameter "stringUploadWarning".
     */
    public final static String DEFAULT_STRING_UPLOAD_WARNING = "^WARNING: (.*)$";

    /**
     * Default value for parameter "targetPictureFormat".
     */
    public final static String DEFAULT_TARGET_PICTURE_FORMAT = null;

    /**
     * Default value for parameter "uploadPolicy".
     */
    public final static String DEFAULT_UPLOAD_POLICY = "DefaultUploadPolicy";

    /**
     * Default value for parameter "urlToSendErrorTo".
     */
    public final static String DEFAULT_URL_TO_SEND_ERROR_TO = null;

    /**
     * Default value for parameter "formdata"
     * 
     * @since 2.9.2rc4
     */
    public final static String DEFAULT_FORMDATA = null;

    /***************************************************************************
     * ************************************************************************
     * ************************* LIST OF ALLOWED VALUES *********************
     * ************************************************************************
     **************************************************************************/

    /** Indicates that the log window is always visible. */
    public final String SHOWLOGWINDOW_TRUE = "true";

    /** Indicates that the log window is always hidden. */
    public final String SHOWLOGWINDOW_FALSE = "false";

    /**
     * Indicates that the log window is hidden, and will become visible only
     * when an error occurs.
     */
    public final String SHOWLOGWINDOW_ONERROR = "onError";

    /***************************************************************************
     * *************************************************************************
     * ********************* LIST OF METHODS **********************************
     * *************************************************************************
     **************************************************************************/

    /**
     * This method allows the upolad policy to override the content of the
     * applet part that is above the file list, called here the 'top panel'.
     * That is: the part that contains the Browse, Remove and RemoveAll buttons.
     * The default implementation is defined in
     * {@link wjhk.jupload2.policies.DefaultUploadPolicy#createTopPanel(JButton, JButton, JButton, JUploadPanel)}.
     * <BR>
     * You can see an example in the
     * {@link PictureUploadPolicy#createTopPanel(JButton, JButton, JButton, JUploadPanel)}
     * upload policy implementation. <BR>
     * <B>Note:</B> This method is called by the
     * {@link DefaultUploadPolicy#addComponentsToJUploadPanel(JUploadPanel)}
     * method. If you create an upload policy that overrides the
     * addComponentsToJUploadPanel method, it's up to you to call it.
     * 
     * @param browse The default browse button.
     * @param remove The default removeSelected button.
     * @param removeAll The default removeAll button.
     * @param mainPanel The panel that contains all objects.
     * @return the topPanel, that will be displayed on the top of the Applet.
     */
    public JPanel createTopPanel(JButton browse, JButton remove,
            JButton removeAll, JUploadPanel mainPanel);

    /**
     * This method is called to create the progress panel. The default
     * implementation is defined in
     * {@link wjhk.jupload2.policies.DefaultUploadPolicy#createProgressPanel(JProgressBar, JProgressBar, JButton, JButton, JPanel)}.
     * 
     * @param preparationProgressBar The default preparation progress bar.
     * @param uploadProgressBar The default upload progress bar.
     * @param uploadButton The default upload button.
     * @param stopButton The default stop button.
     * @param mainPanel The panel that contains all objects.
     * @return the topPanel, that will be displayed on the top of the Applet.
     */
    public JPanel createProgressPanel(JProgressBar preparationProgressBar,
            JProgressBar uploadProgressBar, JButton uploadButton,
            JButton stopButton, JPanel mainPanel);

    /**
     * This method is used to create a new status bar. The default
     * implementation is defined in
     * {@link wjhk.jupload2.policies.DefaultUploadPolicy#createStatusBar(JLabel, JPanel)}.
     * 
     * @param statusContent The status bar content
     * @param mainPanel The panel that contains all objects.
     * @return the topPanel, that will be displayed on the top of the Applet.
     */
    public JPanel createStatusBar(JLabel statusContent, JPanel mainPanel);

    /**
     * This methods allow the upload policy to override the default disposition
     * of the components on the applet.
     * 
     * @param jUploadPanel The main applet panel.
     * 
     * @see #createTopPanel(JButton, JButton, JButton, JUploadPanel)
     */
    public void addComponentsToJUploadPanel(JUploadPanel jUploadPanel);

    /**
     * This methods creates a new FileData instance (or one of its inherited
     * classes), and return it to the caller.
     * 
     * @param 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'.
     * @param root An optional toplevel directory of a hierarchy (can be null).
     * @return A FileData instance. The exact class depends on the
     *         currentUploadPolicy. Can be null, if the policy performs checks,
     *         and the given file is not Ok for these controls. See
     *         {@link 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.
     * @throws 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.
     */
    public FileData createFileData(File file, File root)
            throws JUploadExceptionStopAddingFiles;

    /**
     * This method displays the applet parameter list, according to the current
     * debugLevel. It is called by the {@link #setDebugLevel(int)} method. It
     * should be override by any subclasses, that should display its own
     * parameters, then call <i>super.displayParameterStatus()</i>.
     */
    public void displayParameterStatus();

    // //////////////////////////////////////////////////////////////////////////////////////////////
    // /////////////////// getters / setters
    // //////////////////////////////////////////////////////////////////////////////////////////////

    /**
     * This allow runtime modifications of properties. With this method, you can
     * change any applet parameter after the applet initilization, with
     * JavaScript for instance. If the applet parameters given in <i>prop</i>
     * is not managed by this method, a warning is displayed in the log window.
     * 
     * @param prop The applet parameter name.
     * @param value The new value for this parameter. If the value is not valid
     *            (for instance <i>aaa</i> for a number), a warning is
     *            displayed in the log window, and the existing value is not
     *            changed.
     * @throws JUploadException
     * @exception JUploadExceptionStopAddingFiles indicates that the applet
     *                should stop strying adding the current file selection.
     *                Useful for instance, when a user drop a directory, full of

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -