Lines Matching refs:ps

642             PrintStream ps = new PrintStream(s.getOutputStream());
667 ps.print(HTTP_VERSION_STRING + " " + HTTP_BAD_METHOD +
669 ps.write(buf, 0, 5);
670 ps.write(EOL);
671 ps.flush();
688 printStatus(ps);
689 printHeaders(ps);
692 psWriteEOL(ps);
699 send404(ps);
701 sendFile(ps);
710 sendFile(ps);
722 psPrint(ps, TestWebData.testServerResponse[TestWebData.REDIRECT_301]);
726 psPrint(ps, TestWebData.testServerResponse[TestWebData.REDIRECT_302]);
729 psPrint(ps, TestWebData.testServerResponse[TestWebData.REDIRECT_303]);
732 psPrint(ps, TestWebData.testServerResponse[TestWebData.REDIRECT_307]);
739 ps.flush();
752 void psPrint(PrintStream ps, String s) throws IOException {
754 ps.print(s);
758 void psWrite(PrintStream ps, byte[] bytes, int len) throws IOException {
760 ps.write(bytes, 0, len);
764 void psWriteEOL(PrintStream ps) throws IOException {
766 ps.write(EOL);
771 void printStatus(PrintStream ps) throws IOException {
775 psPrint(ps, HTTP_VERSION_STRING + " " + redirectCode +" Moved permanently");
776 psWriteEOL(ps);
777 psPrint(ps, "Location: " + redirectHost);
778 psWriteEOL(ps);
788 psPrint(ps, HTTP_VERSION_STRING + " " + HTTP_NOT_FOUND + " not found");
789 psWriteEOL(ps);
791 psPrint(ps, HTTP_VERSION_STRING + " " + HTTP_OK+" OK");
792 psWriteEOL(ps);
799 * @param ps The PrintStream to output response headers and data to
801 void printHeaders(PrintStream ps) throws IOException {
802 psPrint(ps,"Server: TestWebServer"+mPort);
803 psWriteEOL(ps);
804 psPrint(ps, "Date: " + (new Date()));
805 psWriteEOL(ps);
806 psPrint(ps, "Connection: " + ((keepAlive) ? "Keep-Alive" : "Close"));
807 psWriteEOL(ps);
814 psPrint(ps, "Transfer-Encoding: chunked");
816 psPrint(ps, "Content-length: "+TestWebData.testParams[testNum].testLength);
818 psWriteEOL(ps);
820 psPrint(ps,"Last Modified: " + (new
822 psWriteEOL(ps);
824 psPrint(ps, "Content-type: " + TestWebData.testParams[testNum].testType);
825 psWriteEOL(ps);
827 psPrint(ps, "Content-type: text/html");
828 psWriteEOL(ps);
832 psPrint(ps, "Content-length: "+(TestWebData.testServerResponse[TestWebData.REDIRECT_301]).length());
833 psWriteEOL(ps);
834 psWriteEOL(ps);
842 * @param ps The PrintStream to write to
844 void send404(PrintStream ps) throws IOException {
845 ps.println("Not Found\n\n"+
851 * @param ps The PrintStream to write to
853 void sendFile(PrintStream ps) throws IOException {
859 psPrint(ps, Integer.toHexString(dataSize));
860 psWriteEOL(ps);
861 psWrite(ps, TestWebData.tests[testNum], dataSize);
862 psWriteEOL(ps);
863 psPrint(ps, "0");
864 psWriteEOL(ps);
865 psWriteEOL(ps);
867 psWrite(ps, TestWebData.tests[testNum], dataSize);