1 5 6 package com.raptus.owxv3.api; 7 8 import java.sql.SQLException ; 9 import java.util.Vector ; 10 11 import com.raptus.owxv3.LoggingManager; 12 13 42 public class AllFileSelector extends Object 43 { 44 45 46 49 protected String [] allCategories = null; 50 51 52 55 protected Vector allFiles = null; 56 57 58 61 public AllFileSelector(GlobalResources gres) 62 throws SQLException 63 { 64 reset(); 65 allCategories = gres.loadAllCategories(); 66 allFiles=gres.loadFiles(); 67 68 } 69 70 73 public void reset() 74 { 75 76 } 77 78 81 protected String getDefaultCategory() 82 { 83 if(allCategories != null && allCategories.length > 0) 84 return allCategories[0]; 85 86 LoggingManager.log("Unable to determine the default file category!"); 87 return null; 88 } 89 90 91 94 public String [] getAllCategories() { return allCategories; } 95 96 100 101 102 public String [] getAllFileIds(){ 103 GResFile grfile; 104 String ret[]=new String [allFiles.size()]; 105 for (int i=0;i<allFiles.size();i++){ 106 grfile=(GResFile)allFiles.elementAt(i); 107 ret[i]=Integer.toString( grfile.getRowID() ); 108 109 } 110 return ret; 111 } 112 113 116 117 public String [] getAllFileNames(){ 118 GResFile grfile; 119 String ret[]=new String [allFiles.size()]; 120 for (int i=0;i<allFiles.size();i++){ 121 grfile=(GResFile)allFiles.elementAt(i); 122 ret[i]=grfile.getFileName(); 123 124 } 125 return ret; 126 } 127 128 129 130 131 } 132 133 | Popular Tags |