jdk/test/java/net/URLConnection/HandleContentTypeWithAttrs.java
author ohair
Tue, 28 Dec 2010 15:53:50 -0800
changeset 7668 d4a77089c587
parent 6115 7c523cf2bc8a
child 30820 0d4717a011d3
permissions -rw-r--r--
6962318: Update copyright year Reviewed-by: xdono
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
7668
d4a77089c587 6962318: Update copyright year
ohair
parents: 6115
diff changeset
     2
 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
 * @test
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
 * @bug 4160200
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 * @summary Make sure URLConnection.getContnentHandler
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 *     can handle MIME types with attributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.net.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.io.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import sun.net.www.content.text.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import sun.net.www.MessageHeader;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
public class HandleContentTypeWithAttrs {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
    URL url;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
    public HandleContentTypeWithAttrs (int port) throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
        String localHostName = InetAddress.getLocalHost().getHostName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
        // Request echo.html from myHttpServer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
        // In the header of the response, we make
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
        // the content type have some attributes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
        url = new URL("http://" + localHostName + ":" + port + "/echo.html");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
        URLConnection urlConn = url.openConnection();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
        // the method getContent() calls the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
        // getContentHandler(). With the fix, the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
        // getContentHandler() gets the correct content
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
        // handler for our response -  it should be the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
        // PlainText conten handler; without the fix,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
        // it gets the UnknownContent handler.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
        // So based on what the getContent()
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
        // returns, we know whether getContentHandler()
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
        // can handle content type with attributes or not.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
        Object obj = urlConn.getContent();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
        if (!(obj instanceof PlainTextInputStream))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
            throw new Exception("Cannot get the correct content handler.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    public static void main(String [] argv) throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
        // Start myHttpServer
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
        myHttpServer testServer = new myHttpServer();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        testServer.startServer(0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
        int serverPort = testServer.getServerLocalPort();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
        new HandleContentTypeWithAttrs(serverPort);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
// myHttpServer is pretty much like
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
// sun.net.www.httpd.BasicHttpServer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
// But we only need it to handle one
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
// simple request.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
class myHttpServer implements Runnable, Cloneable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    /** Socket for communicating with client. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    public Socket clientSocket = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    private Thread serverInstance;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    private ServerSocket serverSocket;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    /** Stream for printing to the client. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    public PrintStream clientOutput;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    /** Buffered stream for reading replies from client. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    public InputStream clientInput;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    static URL defaultContext;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    /** Close an open connection to the client. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    public void close() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
        clientSocket.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        clientSocket = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
        clientInput = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        clientOutput = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    final public void run() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        if (serverSocket != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
            Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
            try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
                // wait for incoming request
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
                Socket ns = serverSocket.accept();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
                myHttpServer n = (myHttpServer)clone();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
                n.serverSocket = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
                n.clientSocket = ns;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
                new Thread(n).start();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
            } catch(Exception e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
                System.out.print("Server failure\n");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
                e.printStackTrace();
6115
7c523cf2bc8a 6969395: TEST_BUG: Tests in java/net sun/net problems
chegar
parents: 5506
diff changeset
   114
            } finally {
7c523cf2bc8a 6969395: TEST_BUG: Tests in java/net sun/net problems
chegar
parents: 5506
diff changeset
   115
                try { serverSocket.close(); } catch(IOException unused) {}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
            try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
                clientOutput = new PrintStream(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
                    new BufferedOutputStream(clientSocket.getOutputStream()),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
                                             false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
                clientInput = new BufferedInputStream(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                                             clientSocket.getInputStream());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
                serviceRequest();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
            } catch(Exception e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
                // System.out.print("Service handler failure\n");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
                // e.printStackTrace();
6115
7c523cf2bc8a 6969395: TEST_BUG: Tests in java/net sun/net problems
chegar
parents: 5506
diff changeset
   129
            } finally {
7c523cf2bc8a 6969395: TEST_BUG: Tests in java/net sun/net problems
chegar
parents: 5506
diff changeset
   130
                try { close(); }  catch(IOException unused) {}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
    /** Start a server on port <i>port</i>.  It will call serviceRequest()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
        for each new connection. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
    final public void startServer(int port) throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
        serverSocket = new ServerSocket(port, 50);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
        serverInstance = new Thread(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
        serverInstance.start();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    final public int getServerLocalPort() throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
        if (serverSocket != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
            return serverSocket.getLocalPort();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
        throw new Exception("serverSocket is null");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    MessageHeader mh;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    final public void serviceRequest() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
        //totalConnections++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
            mh = new MessageHeader(clientInput);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
            String cmd = mh.findValue(null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
            // if (cmd == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
            //  error("Missing command " + mh);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
            //  return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
            // }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
            int fsp = cmd.indexOf(' ');
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
            // if (fsp < 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
            //  error("Syntax error in command: " + cmd);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
            //  return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
            //  }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
            String k = cmd.substring(0, fsp);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
            int nsp = cmd.indexOf(' ', fsp + 1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
            String p1, p2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
            if (nsp > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
                p1 = cmd.substring(fsp + 1, nsp);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
                p2 = cmd.substring(nsp + 1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
                p1 = cmd.substring(fsp + 1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
                p2 = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
            // expectsMime = p2 != null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
            if (k.equalsIgnoreCase("get"))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
                getRequest(new URL(defaultContext, p1), p2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
            else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
                //      error("Unknown command: " + k + " (" + cmd + ")");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
                return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
        } catch(IOException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
            // totally ignore IOException.  They're usually client crashes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
        } catch(Exception e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
            //  error("Exception: " + e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
            e.printStackTrace();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    /** Satisfy one get request.  It is invoked with the clientInput and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
        clientOutput streams initialized.  This method handles one client
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
        connection. When it is done, it can simply exit. The default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
        server just echoes it's input. */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
    protected void getRequest(URL u, String param) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
            if (u.getFile().equals("/echo.html")) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
               startHtml("Echo reply");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
               clientOutput.print("<p>URL was " + u.toExternalForm() + "\n");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
               clientOutput.print("<p>Socket was " + clientSocket + "\n<p><pre>");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
               mh.print(clientOutput);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
           }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
        } catch(Exception e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
            System.out.print("Failed on "+u.getFile()+"\n");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
            e.printStackTrace();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
      * Clone this object;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    public Object clone() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
            return super.clone();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
        } catch (CloneNotSupportedException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
            // this shouldn't happen, since we are Cloneable
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
            throw new InternalError();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    public myHttpServer () {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
            defaultContext
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
            = new URL("http", InetAddress.getLocalHost().getHostName(), "/");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
        } catch(Exception e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
            System.out.println("Failed to construct defauit URL context: "
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
                               + e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
            e.printStackTrace();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
    // Make the content type have some attributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    protected void startHtml(String title) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
        clientOutput.print("HTTP/1.0 200 Document follows\n" +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
                           "Server: Java/" + getClass().getName() + "\n" +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
                           "Content-type: text/plain; charset=Shift_JIS \n\n");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
}