| 1 22 23 package com.ice.util; 24 25 import java.util.*; 26 27 28 public class 29 HTTPUtilities 30 { 31 32 static public String [] 36 parseStatusLine( String statusLine ) 37 { 38 StringTokenizer toker = 39 new StringTokenizer( statusLine, " \t" ); 40 41 int count = toker.countTokens(); 42 String [] result = new String [count]; 43 44 for ( int i = 0 ; i < count ; ++i ) 45 { 46 try { result[i] = toker.nextToken(); } 47 catch ( NoSuchElementException ex ) 48 { break; } 49 } 50 51 return result; 52 } 53 54 static public String  55 getResultCode( String statusLine ) 56 { 57 String [] tokes = 58 HTTPUtilities.parseStatusLine( statusLine ); 59 60 if ( tokes.length > 1 ) 61 return tokes[1]; 62 else 63 return null; 64 } 65 66 } 67 68 69 | Popular Tags |