FileDocCategorySizeDatePackage
Utils.javaAPI DocphoneME MR2 API (J2ME)9605Wed May 02 18:00:44 BST 2007com.sun.j2me.payment

Utils

public abstract class Utils extends Object
This class provides utility methods. They are implemented in a subclass of this class. An instance of it can be obtained from the payment module.

This approach allows the com.sun.j2me.payment package to be more independent on MIDP classes.

version
1.2

Fields Summary
public static final int
PAYMENT_ID_BASE
The starting value of the resource keys.
public static final int
PAYMENT_PROV_SEL_DLG_NEVER
Resource string. never
public static final int
PAYMENT_PROV_SEL_DLG_NO
Resource string. No
public static final int
PAYMENT_PROV_SEL_DLG_YES
Resource string. Yes
public static final int
PAYMENT_PROV_SEL_DLG_UPDATE
Resource string. Update
public static final int
PAYMENT_UPDATE_DLG_STOP
Resource string. Stop
public static final int
PAYMENT_UPDATE_DLG_CAPTION
Resource string. Updating payment information...
public static final int
PAYMENT_PROV_SEL_DLG_PAY_BY
Resource string. Pay by
public static final int
PAYMENT_PROV_SEL_DLG_UPDATE_DATE
Resource string. Update date:
public static final int
PAYMENT_PROV_SEL_DLG_UPDATE_STAMP
Resource string. Update stamp:
public static final int
PAYMENT_UPDATE_DLG_CANCELLING
Resource string. Cancelling...
public static final int
PAYMENT_UPDATE_DLG_CONNECTING
Resource string. Connecting...
public static final int
PAYMENT_UPDATE_DLG_SENDING
Resource string. Sending request...
public static final int
PAYMENT_UPDATE_DLG_WAITING
Resource string. Waiting for server...
public static final int
PAYMENT_UPDATE_DLG_DOWNLOADING
Resource string. Downloading...
public static final int
PAYMENT_UPDATE_DLG_VERIFYING
Resource string. Verifying...
public static final int
PAYMENT_UPDATE_DLG_RETRY
Resource string. (Retry %1/%2)
public static final int
PAYMENT_ERROR_DLG_CAPTION
Resource string. Update Error
public static final int
PAYMENT_ERROR_PREFIX
Resource string. Can not update.
public static final int
PAYMENT_ERROR_SUFFIX
Resource string. Contact your application provider to correct this situation.
public static final int
PAYMENT_ERROR_PERMISSIONS
Resource string. The application has not got permission to download the update file from the server.
public static final int
PAYMENT_ERROR_DOWNLOAD_FAILED
Resource string. Failed to download the update file from the server.
public static final int
PAYMENT_ERROR_UPDATE_NOT_SUPPORTED
Resource string. The payment information on the server is not supported.
public static final int
PAYMENT_ERROR_UPDATE_NOT_YET_VALID
Resource string. The payment information on the server is not yet valid.
public static final int
PAYMENT_ERROR_UPDATE_EXPIRED
Resource string. The payment information on the server is expired.
public static final int
PAYMENT_ERROR_UPDATE_INVALID
Resource string. The payment information on the server is invalid.
public static final int
PAYMENT_ERROR_UPDATE_INCOMPLETE
Resource string. The payment information on the server is incomplete.
public static final int
PAYMENT_ERROR_UPDATE_NOT_FOUND
Resource string. The payment update file has not been found at its URL.
public static final int
PAYMENT_ERROR_CONNECTION_FAILED
Resource string. Connection with the server failed.
public static final int
PAYMENT_ERROR_UPDATE_INVALID_TYPE
Resource string. The payment information on the server is of an invalid type.
public static final int
PAYMENT_ERROR_CERTIFICATE_EXPIRED
Resource string. The certificate used to sign the update file on the server is expired or not yet valid.
public static final int
PAYMENT_ERROR_CERTIFICATE_INCORRECT
Resource string. The certificate used to sign the update file on the server is incorrect or unsupported.
public static final int
PAYMENT_ERROR_CERTIFICATE_UNTRUSTED
Resource string. The certificate used to sign the update file on the server is not trusted.
public static final int
PAYMENT_ERROR_VERIFICATION_FAILED
Resource string. The verification of the update file signature failed.
public static final int
PAYMENT_UPDATE_DLG_QUESTION
Resource string. Are you sure, you want to buy this feature for %1 %2.%3 using %4 provided by %5?
Constructors Summary
protected Utils()
Creates a new instance of Utils.


           
      
    
Methods Summary
public abstract java.lang.StringformatISODate(long date)
Converts the given date to the string formatted according to the ISO 8601 standard.

param
date the date as the number of milliseconds elapsed since 1970-1-1 GMT
return
the date string

public abstract java.lang.StringgetString(int key)
Returns a resource string for the given key.

param
key the key
return
the string assigned to the key

public abstract java.lang.StringgetString(int key, java.lang.String[] values)
Returns a modified resource string for the given key. It replaces any occurence of %1, %2, ... in the original resource string with the first, second, ... string from values.

param
key the key
param
values the replacement strings
return
the modified resource string

public abstract com.sun.midp.util.PropertiesloadProperties(java.io.InputStream is, java.lang.String charset)
Parses properties from the given input stream and returns them as an instance of the Properties class. The charset parameter contains the actual character encoding of the input stream.

param
is the input stream which contains properties
param
charset the character set of the input stream
return
the properties read from the stream
throws
UnsupportedEncodingException if charset is not supported by the implementation
throws
IOException if the input stream doesn't have properties in the correct format

public abstract longparseISODate(java.lang.String date)
Parses a date string according to the ISO 8601 standard.

param
date the date string in the format YYYY-MM-DDTHH:MM[:SS][[+|-] HH[MM]]
return
the number of milliseconds elapsed since 1970-1-1 GMT to this date
throws
IllegalArgumentException if the format of the date string is incorrect or the date is invalid