1 19 20 package com.sslexplorer.vfs.store.site; 21 22 import java.io.File ; 23 import java.util.ArrayList ; 24 import java.util.List ; 25 26 import javax.servlet.http.HttpServletRequest ; 27 28 import com.sslexplorer.boot.ContextHolder; 29 import com.sslexplorer.properties.Pair; 30 import com.sslexplorer.properties.PairListDataSource; 31 32 public class SiteIconsListDataSource implements PairListDataSource { 33 34 public List getValues(HttpServletRequest request) { 35 File dir = new File (new File (ContextHolder.getContext().getConfDirectory(), "site"), "icons"); 36 List l = new ArrayList (); 37 l.add(new Pair("default", "Default")); 38 if(dir.exists() && dir.canRead()) { 39 String [] names = dir.list(); 40 for(int i = 0 ; i < names.length; i++) { 41 l.add(new Pair(names[i], names[i])); 42 } 43 } 44 return l; 45 } 46 } 47 | Popular Tags |