Package sun.net.www

Examples of sun.net.www.MessageHeader


      throw new IllegalStateException("Already connected");
  if (key == null)
      throw new NullPointerException ("key is null");

        if (requests == null)
            requests = new MessageHeader();

  requests.set(key, value);
    }
View Full Code Here


      throw new IllegalStateException("Already connected");
  if (key == null)
      throw new NullPointerException ("key is null");

  if (requests == null)
      requests = new MessageHeader();

  requests.add(key, value);
    }
View Full Code Here

            throw new IllegalStateException("Already connected");
        if (key == null)
            throw new NullPointerException ("key is null");

        if (requests == null)
            requests = new MessageHeader();

        requests.set(key, value);
    }
View Full Code Here

            throw new IllegalStateException("Already connected");
        if (key == null)
            throw new NullPointerException ("key is null");

        if (requests == null)
            requests = new MessageHeader();

        requests.add(key, value);
    }
View Full Code Here

            throw new IllegalStateException("Already connected");
        if (key == null)
            throw new NullPointerException ("key is null");

        if (requests == null)
            requests = new MessageHeader();

        requests.set(key, value);
    }
View Full Code Here

            throw new IllegalStateException("Already connected");
        if (key == null)
            throw new NullPointerException ("key is null");

        if (requests == null)
            requests = new MessageHeader();

        requests.add(key, value);
    }
View Full Code Here

            is.mark(1);
            if (is.read() == -1) { // EOF
                break;
            }
            is.reset();
            MessageHeader m = new MessageHeader(is);
            if (compute) {
                doHashes(m);
            }
            addEntry(m);
        }
View Full Code Here

        }
    }

    /* recursively generate manifests from directory tree */
    public Manifest(String[] files) throws IOException {
        MessageHeader globals = new MessageHeader();
        globals.add("Manifest-Version", VERSION);
        String jdkVersion = System.getProperty("java.version");
        globals.add("Created-By", "Manifest JDK "+jdkVersion);
        addEntry(globals);
        addFiles(null, files);
    }
View Full Code Here

    }

    public void addFile(File f) throws IOException {
        String stdName = localToStd(f.getPath());
        if (tableEntries.get(stdName) == null) {
            MessageHeader mh = new MessageHeader();
            mh.add("Name", stdName);
            addEntry(mh);
        }
    }
View Full Code Here

        }

        /* the first header in the file should be the global one.
         * It should say "Manifest-Version: x.x"; if not add it
         */
        MessageHeader globals = (MessageHeader) entries.elementAt(0);

        if (globals.findValue("Manifest-Version") == null) {
            /* Assume this is a user-defined manifest.  If it has a Name: <..>
             * field, then it is not global, in which case we just add our own
             * global Manifest-version: <version>
             * If the first MessageHeader has no Name: <..>, we assume it
             * is a global header and so prepend Manifest to it.
             */
            String jdkVersion = System.getProperty("java.version");

            if (globals.findValue("Name") == null) {
                globals.prepend("Manifest-Version", VERSION);
                globals.add("Created-By", "Manifest JDK "+jdkVersion);
            } else {
                ps.print("Manifest-Version: "+VERSION+"\r\n"+
                         "Created-By: "+jdkVersion+"\r\n\r\n");
            }
            ps.flush();
        }

        globals.print(ps);

        for (int i = 1; i < entries.size(); ++i) {
            MessageHeader mh = (MessageHeader) entries.elementAt(i);
            mh.print(ps);
        }
    }
View Full Code Here

TOP

Related Classes of sun.net.www.MessageHeader

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.