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

📄 invalidjadexception.java

📁 有关j2me的很好的例子可以研究一下
💻 JAVA
字号:
/** * * @(#)InvalidJadException.java	1.13 01/08/23 * * Copyright 2001 by Sun Microsystems, Inc., * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. * All rights reserved. */package com.sun.midp.midletsuite;/** * Thrown when a downloaded JAD is discovered to be invalid. This includes * this signed JAD's also. Since some of the conditions that cause this * exception may be recovered from, this exception contains a specific * RC (reason code) that so corrective action can be performed. */public class InvalidJadException extends java.io.IOException {    /** (1) The server for the JAD was not found. */    public static final int JAD_SERVER_NOT_FOUND     =  1;    /** (2) The JAD was not found. */    public static final int JAD_NOT_FOUND            =  2;    /** (3) The JAD signature is not the first attribute. */    public static final int SIGNATURE_NOT_FIRST      =  3;    /** (4) The content provider certificate is missing. */    public static final int MISSING_PROVIDER_CERT    =  4;    /** (5) The content provider certificate cannot be decoded. */    public static final int CORRUPT_PROVIDER_CERT    =  5;    /**     * (6) The domain owner that issued the content     * provider certificate is unknown.     */    public static final int UNKNOWN_DOMAIN_OWNER     =  6;    /** (7) The signature of the content provider certificate is invalid. */    public static final int INVALID_PROVIDER_CERT    =  7;    /** (8) The descriptor signature cannot be decoded. */    public static final int CORRUPT_SIGNATURE        =  8;    /** (9) The signature of the descriptor is invalid. */    public static final int INVALID_SIGNATURE        =  9;    /** (10) The content provider certificate is a supported version. */    public static final int UNSUPPORTED_CERT         = 10;    /** (11) The content provider certificate is expired. */    public static final int EXPIRED_PROVIDER_CERT    = 11;    /**     * (12) The domain owner's public key has expired.     * The extra data will be the domain owner's name as a String.     */    public static final int EXPIRED_DOMAIN_OWNER_KEY = 12;    /** (13) The name of MIDlet suite is missing. */    public static final int MISSING_SUITE_NAME       = 13;    /** (14) The vendor is missing. */    public static final int MISSING_VENDOR           = 14;    /** (15) The version is missing. */    public static final int MISSING_VERSION          = 15;    /** (16) The format of the version is invalid. */    public static final int INVALID_VERSION          = 16;    /** (17) This suite is older that the one currently installed. */    public static final int OLD_VERSION              = 17;    /** (18) The URL for the JAR is missing. */    public static final int MISSING_JAR_URL          = 18;    /**     * (19) The server for the JAR was not found at the URL given in     * the JAD.     */    public static final int JAR_SERVER_NOT_FOUND     = 19;    /** (20) The JAR was not found at the URL given in the JAD. */    public static final int JAR_NOT_FOUND            = 20;    /** (21) The JAR size is missing. */    public static final int MISSING_JAR_SIZE         = 21;    /** (22) The JAR digest is missing. */    public static final int MISSING_JAR_DIGEST       = 22;    /** (23) The JAR digest cannot be decoded. */    public static final int CORRUPT_JAR_DIGEST       = 23;    /** (24) The JAR downloaded has an invalid digest. */    public static final int INVALID_JAR_DIGEST = 24;    /**     * (25) The MIDlet suite name does not match the one in the JAR     * manifest.     */    public static final int SUITE_NAME_MISMATCH      = 25;    /** (26) The version does not match the one in the JAR manifest. */    public static final int VERSION_MISMATCH         = 26;    /** (27) The vendor does not match the one in the JAR manifest. */    public static final int VENDOR_MISMATCH          = 27;    /** (28) A key has is not formatted correctly. */    public static final int INVALID_KEY              = 28;    /** (29) A value is not formatted correctly. */    public static final int INVALID_VALUE            = 29;    /**     * (30) Not enough storage for this suite to be installed     * The extra data will be storage needed for the suite in K bytes     * rounded up.     */    public static final int INSUFFICIENT_STORAGE     = 30;    /** (31) The JAR downloaded was not size in the JAD. */    public static final int JAR_SIZE_MISMATCH        = 31;    /** (32) This suite is newer that the one currently installed. */    public static final int NEW_VERSION              = 32;    /** (33) Authentication required or failed. */    public static final int UNAUTHORIZED             = 33;    /**     * (34) The JAD URL is for an installed suite but different than the     * orginal JAD URL.     * The extra data will be previous JAD URL.     */    public static final int JAD_MOVED                = 34;    /** (35) Server does not support basic authentication. */    public static final int CANNOT_AUTH              = 35;    /** (36) The JAR downloaded is corrupt. */    public static final int CORRUPT_JAR              = 36;    /**     * (37) The server did not hava a resource with the correct type     * (code 406) or the JAD downloaded has the wrong media type. In the     * second case the extra data is the Media-Type from the response.     */    public static final int INVALID_JAD_TYPE         = 37;    /**     * (38) The server did not hava a resource with the correct type     * (code 406) or the JAR downloaded has the wrong media type. In the     * second case the extra data is the Media-Type from the response.     */    public static final int INVALID_JAR_TYPE         = 38;    /** (39) The JAD matches a version of a suite already installed. */    public static final int ALREADY_INSTALLED        = 39;    /**     * (40) The device does not support either the configuration or      * profile in the JAD.     */    public static final int DEVICE_INCOMPATIBLE      = 40;    /** (41) The configuration is missing from the manifest. */    public static final int MISSING_CONFIGURATION    = 41;    /** (42) The profile is missing from the manifest. */    public static final int MISSING_PROFILE          = 42;    /** The reason why this exception occured. */    private int reason;    /** Extra data need to correct the problem. */    private String extraData = null;    /**     * Constructs a InvalidJadException with the specified reason.     * @param theReason specific RC (reason code)     */    public InvalidJadException(int theReason) {        super("Reason = " + theReason);        reason = theReason;    }    /**     * Constructs a InvalidJadException with the specified reason and     * extra data.     * @param theReason specific reason code     * @param theExtraData an object that contains data to solve the problem     */    public InvalidJadException(int theReason, String theExtraData) {        this(theReason);        extraData = theExtraData;    }    /**     * Returns specific reason why the exception was thrown.     * @return the RC (reason code)     */    public int getReason() {        return reason;    }    /**     * Returns an extra data String to help to resolve the problem.     * @return extra data string, may be null,     *           type depends on the reason for the exception     */    public String getExtraData() {        return extraData;    }}

⌨️ 快捷键说明

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