Package com.sun.midp.io

Examples of com.sun.midp.io.HttpUrl


            // Parse address to see if there's a port value.
            boolean hasPort = false;
            String addr = msg.getAddress();
            if (addr != null) {
                HttpUrl url = new HttpUrl(addr);
                if (url.port != -1) {
                    /* No port supplied. */
                    hasPort = true;
                }

View Full Code Here


     * @exception IOException is thrown if any error prevents the download
     *   of the JAR
     */
    protected int downloadJAR(String filename)
            throws IOException {
        HttpUrl parsedUrl;
        String url;
        String[] acceptableTypes = {JAR_MT_1, JAR_MT_2};
        String[] extraFieldKeys = new String[3];
        String[] extraFieldValues = new String[3];
        int jarSize;
        String locale;
        String prof;
        int space;
        RandomAccessStream jarOutputStream = null;
        OutputStream outputStream = null;

        parsedUrl = new HttpUrl(info.jarUrl);
        if (parsedUrl.authority == null && info.jadUrl != null) {
            // relative URL, add the JAD URL as the base
            try {
                parsedUrl.addBaseUrl(info.jadUrl);
            } catch (IOException e) {
                postInstallMsgBackToProvider(
                    OtaNotifier.INVALID_JAD_MSG);
                throw new InvalidJadException(
                         InvalidJadException.INVALID_JAR_URL);
            }

            url = parsedUrl.toString();

            // The JAR URL saved to storage MUST be absolute
            info.jarUrl = url;
        } else {
            url = info.jarUrl;
View Full Code Here

     * @return true if the scheme, host and path of the first given url
     *              is identical to the scheme, host and path of the second
     *              given url; false otherwise
     */
    protected boolean isSameUrl(String url1, String url2) {
        HttpUrl newUrl;
        HttpUrl originalUrl;

        try {
            newUrl = new HttpUrl(url1);
            originalUrl = new HttpUrl(url2);

            if (newUrl.scheme.equals(originalUrl.scheme) &&
                newUrl.host.equals(originalUrl.host) &&
                newUrl.path.equals(originalUrl.path)) {
                return true;
View Full Code Here

TOP

Related Classes of com.sun.midp.io.HttpUrl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.