Home | History | Annotate | Download | only in support

Lines Matching refs:ps

569             PrintStream ps = new PrintStream(s.getOutputStream());
596 ps.print(HTTP_VERSION_STRING + " " + HTTP_BAD_METHOD +
598 ps.write(buf, 0, 5);
599 ps.write(EOL);
600 ps.flush();
617 printStatus(ps);
618 printHeaders(ps);
621 psWriteEOL(ps);
628 send404(ps);
630 sendFile(ps);
639 sendFile(ps);
651 psPrint(ps, Support_TestWebData.testServerResponse[Support_TestWebData.REDIRECT_301]);
655 psPrint(ps, Support_TestWebData.testServerResponse[Support_TestWebData.REDIRECT_302]);
658 psPrint(ps, Support_TestWebData.testServerResponse[Support_TestWebData.REDIRECT_303]);
661 psPrint(ps, Support_TestWebData.testServerResponse[Support_TestWebData.REDIRECT_307]);
668 ps.flush();
681 void psPrint(PrintStream ps, String s) throws IOException {
683 ps.print(s);
687 void psWrite(PrintStream ps, byte[] bytes, int offset, int count) throws IOException {
689 ps.write(bytes, offset, count);
693 void psWriteEOL(PrintStream ps) throws IOException {
695 ps.write(EOL);
700 void printStatus(PrintStream ps) throws IOException {
704 psPrint(ps, HTTP_VERSION_STRING + " " + redirectCode +" Moved permanently");
705 psWriteEOL(ps);
706 psPrint(ps, "Location: " + redirectHost);
707 psWriteEOL(ps);
717 psPrint(ps, HTTP_VERSION_STRING + " " + HTTP_NOT_FOUND + " not found");
718 psWriteEOL(ps);
720 psPrint(ps, HTTP_VERSION_STRING + " " + HTTP_OK+" OK");
721 psWriteEOL(ps);
728 * @param ps The PrintStream to output response headers and data to
730 void printHeaders(PrintStream ps) throws IOException {
737 psPrint(ps,"Server: TestWebServer"+mPort);
738 psWriteEOL(ps);
739 psPrint(ps, "Date: " + df.format(new Date()));
740 psWriteEOL(ps);
741 psPrint(ps, "Connection: " + ((keepAlive) ? "Keep-Alive" : "Close"));
742 psWriteEOL(ps);
753 psPrint(ps, "Transfer-Encoding: chunked");
755 psPrint(ps, "Content-length: "
758 psWriteEOL(ps);
760 psPrint(ps, "Last Modified: " + (new Date(
762 psWriteEOL(ps);
764 psPrint(ps, "Content-type: "
766 psWriteEOL(ps);
771 psPrint(ps, "expires: "
773 psWriteEOL(ps);
777 psPrint(ps, "Transfer-Encoding: chunked");
779 psPrint(ps, "Content-length: "+Support_TestWebData.testParams[testNum].testLength);
781 psWriteEOL(ps);
783 psPrint(ps,"Last Modified: " + (new
785 psWriteEOL(ps);
787 psPrint(ps, "Content-type: " + Support_TestWebData.testParams[testNum].testType);
788 psWriteEOL(ps);
793 psPrint(ps, "expires: "
795 psWriteEOL(ps);
798 psPrint(ps, "Content-type: text/html");
799 psWriteEOL(ps);
803 psPrint(ps, "Content-length: "+(Support_TestWebData.testServerResponse[Support_TestWebData.REDIRECT_301]).length());
804 psWriteEOL(ps);
805 psWriteEOL(ps);
813 * @param ps The PrintStream to write to
815 void send404(PrintStream ps) throws IOException {
816 ps.println("Not Found\n\n"+
822 * @param ps The PrintStream to write to
824 void sendFile(PrintStream ps) throws IOException {
830 sendFile(ps, Support_TestWebData.test0Data);
832 sendFile(ps, Support_TestWebData.tests[testNum]);
836 void sendFile(PrintStream ps, byte[] bytes) throws IOException {
841 psPrint(ps, Integer.toHexString(chunkSize));
842 psWriteEOL(ps);
843 psWrite(ps, bytes, offset, chunkSize);
844 psWriteEOL(ps);
847 psPrint(ps, "0");
848 psWriteEOL(ps);
849 psWriteEOL(ps);
851 psWrite(ps, bytes, 0, bytes.length);