1 16 17 package org.apache.jetspeed.services.search; 18 19 import java.io.File ; 21 import java.util.Collection ; 22 23 import org.apache.turbine.services.TurbineServices; 25 26 27 33 public abstract class Search 34 { 35 36 42 protected static SearchService getService() 43 { 44 return (SearchService) TurbineServices 45 .getInstance().getService(SearchService.SERVICE_NAME); 46 } 47 48 54 public static SearchResults search(String searchString) 55 { 56 return getService().search(searchString); 57 } 58 59 64 public static boolean remove(Object o) 65 { 66 return getService().remove(o); 67 } 68 69 74 public static boolean remove(Collection c) 75 { 76 return getService().remove(c); 77 } 78 79 84 public static boolean add(Object o) 85 { 86 return getService().add(o); 87 } 88 89 94 public static boolean add(Collection c) 95 { 96 return getService().add(c); 97 } 98 99 103 public static boolean update(Object o) 104 { 105 return getService().update(o); 106 } 107 108 112 public static boolean update(Collection c) 113 { 114 return getService().update(c); 115 } 116 117 123 public boolean addDirectory(String path, String extension) 124 { 125 File directory = new File (path); 126 File [] files = directory.listFiles(); 127 for (int ix=0; ix < files.length; ix++) 128 { 129 if (files[ix].isDirectory()) 130 { 131 continue; 132 } 133 134 } 136 return true; 137 } 138 139 } 140 | Popular Tags |