1 28 29 package com.caucho.server.webapp; 30 31 import com.caucho.util.CharBuffer; 32 import com.caucho.util.L10N; 33 34 import java.util.ArrayList ; 35 36 39 public class WelcomeFileList { 40 static L10N L = new L10N(WelcomeFileList.class); 41 42 private ArrayList <String > _welcomeFileList = new ArrayList <String >(); 44 45 48 public void addText(String text) 49 { 50 int len = text.length(); 51 int i = 0; 52 CharBuffer cb = new CharBuffer(); 53 while (i < len) { 54 char ch = 0; 55 for (; 56 i < len && (ch = text.charAt(i)) == ' ' || ch == ',' || ch == '\t'; 57 i++) { 58 } 59 60 if (i >= len) 61 break; 62 63 cb.clear(); 64 for (; 65 i < len && (ch = text.charAt(i)) != ' ' && ch != ',' && ch != '\t'; 66 i++) { 67 cb.append(ch); 68 } 69 70 _welcomeFileList.add(cb.toString()); 71 } 72 } 73 74 77 public void addWelcomeFile(String file) 78 { 79 _welcomeFileList.add(file); 80 } 81 82 85 public ArrayList <String > getWelcomeFileList() 86 { 87 return _welcomeFileList; 88 } 89 } 90 | Popular Tags |