KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > snapper > business > SiteImpl


1 /*
2  * snapper
3  *
4  * Enhydra super-servlet business object
5  *
6  */

7
8 package org.enhydra.snapper.business;
9
10 // Enhydra SuperServlet specification imports
11

12 import java.io.File JavaDoc;
13 import java.sql.Timestamp JavaDoc;
14
15 import org.enhydra.snapper.Log;
16 import org.enhydra.snapper.Snapper;
17 import org.enhydra.snapper.spec.*;
18 import org.enhydra.snapper.data.*;
19
20 import com.lutris.appserver.server.sql.DBTransaction;
21 import com.lutris.appserver.server.sql.ObjectId;
22 import com.lutris.dods.builder.generator.query.DataObjectException;
23
24 // Standard imports
25
//import java.text.DateFormat;
26

27 public class SiteImpl implements Site {
28     protected SitesDO sitesDO = null;
29
30     public SiteImpl() {
31     }
32
33     public SiteImpl(DBTransaction dbt) {
34         try {
35             this.sitesDO = SitesDO.createVirgin(dbt);
36         } catch (Exception JavaDoc ex) {
37             Log.log(ex.toString());
38         }
39
40     }
41
42     public void createNew(DBTransaction dbt) {
43         try {
44             this.sitesDO = SitesDO.createVirgin(dbt);
45         } catch (Exception JavaDoc ex) {
46             Log.log(ex.toString());
47
48         }
49     }
50
51     protected SiteImpl(SitesDO site, DBTransaction dbt) throws Exception JavaDoc {
52         this.sitesDO = SitesDO.createExisting(site.get_Handle(), dbt);
53
54     }
55
56     public String JavaDoc getMETADB() throws Exception JavaDoc {
57         try {
58             return sitesDO.getMETADB();
59         } catch (DataObjectException ex) {
60             Log.logException(ex);
61             throw new Exception JavaDoc("Error getting site's META DB", ex);
62         }
63
64     }
65
66     public void setMETADB(String JavaDoc str) throws Exception JavaDoc {
67         try {
68             sitesDO.setMETADB(str);
69         } catch (Exception JavaDoc ex) {
70             Log.logException(ex);
71             throw new Exception JavaDoc("Error setting META db", ex);
72         }
73     }
74
75     public String JavaDoc getMETATABLE() throws Exception JavaDoc {
76         try {
77             return sitesDO.getMETATABLE();
78         } catch (DataObjectException ex) {
79             Log.logException(ex);
80             throw new Exception JavaDoc("Error getting site's META TABLE", ex);
81         }
82     }
83
84     public void setMETATABLE(String JavaDoc str) throws Exception JavaDoc {
85         try {
86             sitesDO.setMETATABLE(str);
87         } catch (Exception JavaDoc ex) {
88             Log.logException(ex);
89             throw new Exception JavaDoc("Error setting meta TABLE", ex);
90         }
91     }
92
93     public void setMETAFILE(String JavaDoc str) throws Exception JavaDoc {
94         try {
95             sitesDO.setMETAFILECOLUMN(str);
96         } catch (Exception JavaDoc ex) {
97             Log.logException(ex);
98             throw new Exception JavaDoc("Error setting META FILE COLUMN", ex);
99         }
100     }
101
102     public String JavaDoc getMETAFILE() throws Exception JavaDoc {
103         try {
104             return sitesDO.getMETAFILECOLUMN();
105         } catch (DataObjectException ex) {
106             Log.logException(ex);
107             throw new Exception JavaDoc("Error getting site's META FILE COLUMN", ex);
108         }
109
110     }
111
112     public void setMETAKEY(String JavaDoc str) throws Exception JavaDoc {
113         try {
114             sitesDO.setMETAKEYCOLUMN(str);
115         } catch (Exception JavaDoc ex) {
116             Log.logException(ex);
117             throw new Exception JavaDoc("Error setting META KEY COLUMN", ex);
118         }
119     }
120
121     public String JavaDoc getMETAKEY() throws Exception JavaDoc {
122         try {
123             return sitesDO.getMETAKEYCOLUMN();
124         } catch (DataObjectException ex) {
125             Log.logException(ex);
126             throw new Exception JavaDoc("Error getting site's META KEY COLUMN", ex);
127         }
128
129     }
130
131     public void setMETAVALUE(String JavaDoc str) throws Exception JavaDoc {
132         try {
133             sitesDO.setMETAVALUECOLUMN(str);
134         } catch (Exception JavaDoc ex) {
135             Log.logException(ex);
136             throw new Exception JavaDoc("Error setting META VALUE COLUMN", ex);
137         }
138     }
139
140     public String JavaDoc getMETAVALUE() throws Exception JavaDoc {
141         try {
142             return sitesDO.getMETAVALUECOLUMN();
143         } catch (DataObjectException ex) {
144             Log.logException(ex);
145             throw new Exception JavaDoc("Error getting site's META VALUE COLUMN", ex);
146         }
147
148     }
149
150     public String JavaDoc getINCLUDEDB() throws Exception JavaDoc {
151         try {
152             return sitesDO.getINCLUDEDB();
153         } catch (DataObjectException ex) {
154             Log.logException(ex);
155             throw new Exception JavaDoc("Error getting site's INCLUDE DB", ex);
156         }
157
158     }
159
160     public void setINCLUDEDB(String JavaDoc str) throws Exception JavaDoc {
161         try {
162             sitesDO.setINCLUDEDB(str);
163         } catch (Exception JavaDoc ex) {
164             Log.logException(ex);
165             throw new Exception JavaDoc("Error setting INCLUDE db", ex);
166         }
167     }
168
169     public String JavaDoc getINCLUDETABLE() throws Exception JavaDoc {
170         try {
171             return sitesDO.getINCLUDETABLE();
172         } catch (DataObjectException ex) {
173             Log.logException(ex);
174             throw new Exception JavaDoc("Error getting site's INCLUDE TABLE", ex);
175         }
176     }
177
178     public void setINCLUDETABLE(String JavaDoc str) throws Exception JavaDoc {
179         try {
180             sitesDO.setINCLUDETABLE(str);
181         } catch (Exception JavaDoc ex) {
182             Log.logException(ex);
183             throw new Exception JavaDoc("Error setting include TABLE", ex);
184         }
185     }
186
187     public void setINCLUDECOLUMN(String JavaDoc str) throws Exception JavaDoc {
188         try {
189             sitesDO.setINCLUDECOLUMN(str);
190         } catch (Exception JavaDoc ex) {
191             Log.logException(ex);
192             throw new Exception JavaDoc("Error setting INCLUDE COLUMN", ex);
193         }
194     }
195
196     public String JavaDoc getINCLUDECOLUMN() throws Exception JavaDoc {
197         try {
198             return sitesDO.getINCLUDECOLUMN();
199         } catch (DataObjectException ex) {
200             Log.logException(ex);
201             throw new Exception JavaDoc("Error getting site's INCLUDE COLUMN", ex);
202         }
203
204     }
205     
206     public void setINCLUDECOLUMNMODIFIED(String JavaDoc str) throws Exception JavaDoc {
207         try {
208             sitesDO.setINCLUDECOLUMNMODIFIED(str);
209         } catch (Exception JavaDoc ex) {
210             Log.logException(ex);
211             throw new Exception JavaDoc("Error setting INCLUDE COLUMN", ex);
212         }
213     }
214
215     public String JavaDoc getINCLUDECOLUMNMODIFIED() throws Exception JavaDoc {
216         try {
217             return sitesDO.getINCLUDECOLUMNMODIFIED();
218         } catch (DataObjectException ex) {
219             Log.logException(ex);
220             throw new Exception JavaDoc("Error getting site's INCLUDE COLUMN", ex);
221         }
222
223     }
224
225     public String JavaDoc getFILTERDB() throws Exception JavaDoc {
226         try {
227             return sitesDO.getFILTERDB();
228         } catch (DataObjectException ex) {
229             Log.logException(ex);
230             throw new Exception JavaDoc("Error getting site's filter DB", ex);
231         }
232
233     }
234
235     public void setFILTERDB(String JavaDoc str) throws Exception JavaDoc {
236         try {
237             sitesDO.setFILTERDB(str);
238         } catch (Exception JavaDoc ex) {
239             Log.logException(ex);
240             throw new Exception JavaDoc("Error setting filter db", ex);
241         }
242     }
243
244     public String JavaDoc getFILTERTABLE() throws Exception JavaDoc {
245         try {
246             return sitesDO.getFILTERTABLE();
247         } catch (DataObjectException ex) {
248             Log.logException(ex);
249             throw new Exception JavaDoc("Error getting site's filter TABLE", ex);
250         }
251     }
252
253     public void setFILTERTABLE(String JavaDoc str) throws Exception JavaDoc {
254         try {
255             sitesDO.setFILTERTABLE(str);
256         } catch (Exception JavaDoc ex) {
257             Log.logException(ex);
258             throw new Exception JavaDoc("Error setting FILTER TABLE", ex);
259         }
260     }
261
262     public void setFILTERCOLUMN(String JavaDoc str) throws Exception JavaDoc {
263         try {
264             sitesDO.setFILTERCOLUMN(str);
265         } catch (Exception JavaDoc ex) {
266             Log.logException(ex);
267             throw new Exception JavaDoc("Error setting FILTER COLUMN", ex);
268         }
269     }
270
271     public String JavaDoc getFILTERCOLUMN() throws Exception JavaDoc {
272         try {
273             return sitesDO.getFILTERCOLUMN();
274         } catch (DataObjectException ex) {
275             Log.logException(ex);
276             throw new Exception JavaDoc("Error getting site's FILTER COLUMN", ex);
277         }
278
279     }
280
281     public String JavaDoc getName() throws Exception JavaDoc {
282         try {
283             return sitesDO.getNAME();
284         } catch (DataObjectException ex) {
285             Log.logException(ex);
286             throw new Exception JavaDoc("Error getting site's name", ex);
287         }
288
289     }
290
291     public String JavaDoc getID() throws Exception JavaDoc {
292         try {
293             return sitesDO.get_Handle();
294         } catch (Exception JavaDoc ex) {
295             Log.logException(ex);
296             throw new Exception JavaDoc("Error getting site's ID", ex);
297         }
298
299     }
300
301     public void setName(String JavaDoc str) throws Exception JavaDoc {
302         try {
303             sitesDO.setNAME(str);
304         } catch (Exception JavaDoc ex) {
305             Log.logException(ex);
306             throw new Exception JavaDoc("Error setting name", ex);
307         }
308     }
309
310     public void setLanguage(String JavaDoc str) throws Exception JavaDoc {
311         try {
312             sitesDO.oid_setLANGUAGE(str);
313         } catch (Exception JavaDoc ex) {
314             Log.logException(ex);
315             throw new Exception JavaDoc("Error setting language", ex);
316         }
317     }
318
319     public String JavaDoc getLanguage() throws Exception JavaDoc {
320         try {
321             return String.valueOf(sitesDO.oid_getLANGUAGE());
322         } catch (Exception JavaDoc ex) {
323             Log.logException(ex);
324             throw new Exception JavaDoc("Error getting site's language", ex);
325         }
326
327     }
328
329     public void setSize(String JavaDoc str) throws Exception JavaDoc {
330         try {
331             int size = Integer.parseInt(str);
332             sitesDO.setMAXSIZE(size);
333         } catch (Exception JavaDoc ex) {
334             Log.logException(ex);
335             throw new Exception JavaDoc("Error setting size");
336         }
337     }
338
339     public int getSize() throws Exception JavaDoc {
340         try {
341             return sitesDO.getMAXSIZE();
342         } catch (Exception JavaDoc ex) {
343             Log.logException(ex);
344             throw new Exception JavaDoc("Error getting site's max. size");
345         }
346
347     }
348
349     public int getAge() throws Exception JavaDoc {
350         try {
351             return sitesDO.getMAXAGE();
352         } catch (Exception JavaDoc ex) {
353             Log.logException(ex);
354             throw new Exception JavaDoc("Error getting site's max. age");
355         }
356
357     }
358
359     public void setAge(String JavaDoc str) throws Exception JavaDoc {
360         try {
361             int age = Integer.parseInt(str);
362             sitesDO.setMAXAGE(age);
363         } catch (Exception JavaDoc ex) {
364             Log.logException(ex);
365             throw new Exception JavaDoc("Error setting age");
366         }
367     }
368
369     public void setLOCKED(String JavaDoc str) throws Exception JavaDoc {
370         try {
371             boolean x;
372             if (str == null)
373                 x = false;
374             else
375                 x = true;
376             sitesDO.setLOCKED(x);
377         } catch (Exception JavaDoc ex) {
378             Log.logException(ex);
379             throw new Exception JavaDoc("Error setting locked");
380         }
381     }
382
383     public boolean getLOCKED() throws Exception JavaDoc {
384         try {
385             return sitesDO.getLOCKED();
386         } catch (Exception JavaDoc ex) {
387             Log.logException(ex);
388             throw new Exception JavaDoc("Error getting locked");
389         }
390     }
391     public void setOTHER(String JavaDoc str) throws Exception JavaDoc {
392         try {
393             boolean x;
394             if (str == null)
395                 x = false;
396             else
397                 x = true;
398             sitesDO.setOTHER(x);
399         } catch (Exception JavaDoc ex) {
400             
401             throw new Exception JavaDoc("Error setting other");
402         }
403     }
404     
405     public boolean getOTHER() throws Exception JavaDoc {
406         try {
407             return sitesDO.getOTHER();
408         } catch (Exception JavaDoc ex) {
409             throw new Exception JavaDoc("Error getting other");
410         }
411     }
412
413     public void setRTF(String JavaDoc str) throws Exception JavaDoc {
414         try {
415             boolean x;
416             if (str == null)
417                 x = false;
418             else
419                 x = true;
420             sitesDO.setRTF(x);
421         } catch (Exception JavaDoc ex) {
422             Log.logException(ex);
423             throw new Exception JavaDoc("Error setting rtf");
424         }
425     }
426
427     public boolean getRTF() throws Exception JavaDoc {
428         try {
429             return sitesDO.getRTF();
430         } catch (Exception JavaDoc ex) {
431             Log.logException(ex);
432             throw new Exception JavaDoc("Error getting rtf");
433         }
434     }
435
436     public void setDOC(String JavaDoc str) throws Exception JavaDoc {
437         try {
438             boolean x;
439             if (str == null)
440                 x = false;
441             else
442                 x = true;
443             sitesDO.setWORD(x);
444         } catch (Exception JavaDoc ex) {
445             Log.logException(ex);
446             throw new Exception JavaDoc("Error setting doc");
447         }
448     }
449
450     public boolean getDOC() throws Exception JavaDoc {
451         try {
452             return sitesDO.getWORD();
453         } catch (Exception JavaDoc ex) {
454             Log.logException(ex);
455             throw new Exception JavaDoc("Error getting word");
456         }
457     }
458
459     public void setTXT(String JavaDoc str) throws Exception JavaDoc {
460         try {
461             boolean x;
462             if (str == null)
463                 x = false;
464             else
465                 x = true;
466             sitesDO.setTEXT(x);
467         } catch (Exception JavaDoc ex) {
468             Log.logException(ex);
469             throw new Exception JavaDoc("Error setting txt");
470         }
471     }
472
473     public boolean getTXT() throws Exception JavaDoc {
474         try {
475             return sitesDO.getTEXT();
476         } catch (Exception JavaDoc ex) {
477             Log.logException(ex);
478             throw new Exception JavaDoc("Error getting txt");
479         }
480     }
481
482     public void setHTML(String JavaDoc str) throws Exception JavaDoc {
483         try {
484             boolean x;
485             if (str == null)
486                 x = false;
487             else
488                 x = true;
489             sitesDO.setHTML(x);
490         } catch (Exception JavaDoc ex) {
491             Log.logException(ex);
492             throw new Exception JavaDoc("Error setting html");
493         }
494     }
495
496     public boolean getHTML() throws Exception JavaDoc {
497         try {
498             return sitesDO.getHTML();
499         } catch (Exception JavaDoc ex) {
500             Log.logException(ex);
501             throw new Exception JavaDoc("Error getting html");
502         }
503     }
504
505     public void setMSG(String JavaDoc str) throws Exception JavaDoc {
506         try {
507             boolean x;
508             if (str == null)
509                 x = false;
510             else
511                 x = true;
512             sitesDO.setMSG(x);
513         } catch (Exception JavaDoc ex) {
514             Log.logException(ex);
515             throw new Exception JavaDoc("Error setting msg");
516         }
517     }
518
519     public boolean getMSG() throws Exception JavaDoc {
520         try {
521             return sitesDO.getMSG();
522         } catch (Exception JavaDoc ex) {
523             Log.logException(ex);
524             throw new Exception JavaDoc("Error getting msg");
525         }
526     }
527
528     public void setPDF(String JavaDoc str) throws Exception JavaDoc {
529         try {
530             boolean x;
531             if (str == null)
532                 x = false;
533             else
534                 x = true;
535             sitesDO.setPDF(x);
536         } catch (Exception JavaDoc ex) {
537             Log.logException(ex);
538             throw new Exception JavaDoc("Error setting pdf");
539         }
540     }
541
542     public boolean getPDF() throws Exception JavaDoc {
543         try {
544             return sitesDO.getPDF();
545         } catch (Exception JavaDoc ex) {
546             Log.logException(ex);
547             throw new Exception JavaDoc("Error getting pdf");
548         }
549     }
550
551     public void setXLS(String JavaDoc str) throws Exception JavaDoc {
552         try {
553             boolean x;
554             if (str == null)
555                 x = false;
556             else
557                 x = true;
558             sitesDO.setEXCEL(x);
559         } catch (Exception JavaDoc ex) {
560             Log.logException(ex);
561             throw new Exception JavaDoc("Error setting xls");
562         }
563     }
564
565     public boolean getXLS() throws Exception JavaDoc {
566         try {
567             return sitesDO.getEXCEL();
568         } catch (Exception JavaDoc ex) {
569             Log.logException(ex);
570             throw new Exception JavaDoc("Error getting xls");
571         }
572     }
573
574     public void setZIP(String JavaDoc str) throws Exception JavaDoc {
575         try {
576             boolean x;
577             if (str == null)
578                 x = false;
579             else
580                 x = true;
581             sitesDO.setZIP(x);
582         } catch (Exception JavaDoc ex) {
583             Log.logException(ex);
584             throw new Exception JavaDoc("Error setting zip");
585         }
586     }
587
588     public boolean getZIP() throws Exception JavaDoc {
589         try {
590             return sitesDO.getZIP();
591         } catch (Exception JavaDoc ex) {
592             Log.logException(ex);
593             throw new Exception JavaDoc("Error getting zip");
594         }
595     }
596
597     public void setOO(String JavaDoc str) throws Exception JavaDoc {
598         try {
599             boolean x;
600             if (str == null)
601                 x = false;
602             else
603                 x = true;
604             sitesDO.setOO(x);
605         } catch (Exception JavaDoc ex) {
606             Log.logException(ex);
607             throw new Exception JavaDoc("Error setting OO");
608         }
609     }
610
611     public boolean getOO() throws Exception JavaDoc {
612         try {
613             return sitesDO.getOO();
614         } catch (Exception JavaDoc ex) {
615             Log.logException(ex);
616             throw new Exception JavaDoc("Error getting OO");
617         }
618     }
619
620     public void setPPT(String JavaDoc str) throws Exception JavaDoc {
621         try {
622             boolean x;
623             if (str == null)
624                 x = false;
625             else
626                 x = true;
627             sitesDO.setPPT(x);
628         } catch (Exception JavaDoc ex) {
629             Log.logException(ex);
630             throw new Exception JavaDoc("Error setting ppt");
631         }
632     }
633
634     public boolean getPPT() throws Exception JavaDoc {
635         try {
636             return sitesDO.getPPT();
637         } catch (Exception JavaDoc ex) {
638             Log.logException(ex);
639             throw new Exception JavaDoc("Error getting ppt");
640         }
641     }
642
643     public void setPPS(String JavaDoc str) throws Exception JavaDoc {
644         try {
645             boolean x;
646             if (str == null)
647                 x = false;
648             else
649                 x = true;
650             sitesDO.setPPS(x);
651         } catch (Exception JavaDoc ex) {
652             Log.logException(ex);
653             throw new Exception JavaDoc("Error setting pps");
654         }
655     }
656
657     public boolean getPPS() throws Exception JavaDoc {
658         try {
659             return sitesDO.getPPS();
660         } catch (Exception JavaDoc ex) {
661             Log.logException(ex);
662             throw new Exception JavaDoc("Error getting pps");
663         }
664     }
665
666     public void setEML(String JavaDoc str) throws Exception JavaDoc {
667         try {
668             boolean x;
669             if (str == null)
670                 x = false;
671             else
672                 x = true;
673             sitesDO.setEML(x);
674         } catch (Exception JavaDoc ex) {
675             Log.logException(ex);
676             throw new Exception JavaDoc("Error setting eml");
677         }
678     }
679
680     public boolean getEML() throws Exception JavaDoc {
681         try {
682             return sitesDO.getEML();
683         } catch (Exception JavaDoc ex) {
684             Log.logException(ex);
685             throw new Exception JavaDoc("Error getting eml");
686         }
687     }
688
689     public boolean getSEARCH() throws Exception JavaDoc {
690         try {
691             return sitesDO.getSEARCH();
692         } catch (Exception JavaDoc ex) {
693             Log.logException(ex);
694             throw new Exception JavaDoc("Error getting search");
695         }
696
697     }
698
699     public void setSEARCH(String JavaDoc str) throws Exception JavaDoc {
700         try {
701             boolean x;
702             if (str == null)
703                 x = false;
704             else
705                 x = true;
706             sitesDO.setSEARCH(x);
707         } catch (Exception JavaDoc ex) {
708             Log.logException(ex);
709             throw new Exception JavaDoc("Error setting search");
710         }
711     }
712
713     public boolean getDOWNLOAD() throws Exception JavaDoc {
714         try {
715             return sitesDO.getDOWNLOAD();
716         } catch (Exception JavaDoc ex) {
717             Log.logException(ex);
718             throw new Exception JavaDoc("Error getting download");
719         }
720     }
721
722     public void setDOWNLOAD(String JavaDoc str) throws Exception JavaDoc {
723         try {
724             boolean x;
725             if (str == null)
726                 x = false;
727             else
728                 x = true;
729             sitesDO.setDOWNLOAD(x);
730         } catch (Exception JavaDoc ex) {
731             Log.logException(ex);
732             throw new Exception JavaDoc("Error setting download");
733         }
734     }
735
736     public String JavaDoc getINDEXDIR() throws Exception JavaDoc {
737         try {
738             return sitesDO.getINDEXDIR();
739         } catch (Exception JavaDoc ex) {
740             Log.logException(ex);
741             throw new Exception JavaDoc("Error getting indexdir");
742         }
743
744     }
745
746     public void setINDEXDIR(String JavaDoc str) throws Exception JavaDoc {
747         try {
748             sitesDO.setINDEXDIR(str);
749         } catch (Exception JavaDoc ex) {
750             Log.logException(ex);
751             throw new Exception JavaDoc("Error setting indexname", ex);
752         }
753     }
754
755     public void save() throws Exception JavaDoc {
756         try {
757             this.sitesDO.save();
758         } catch (Exception JavaDoc ex) {
759             Log.logException(ex);
760             throw new Exception JavaDoc("Read-only table: DML operations not allowed");
761         }
762     }
763
764     public void delete() throws Exception JavaDoc {
765         try {
766             this.sitesDO.delete();
767         } catch (Exception JavaDoc ex) {
768             Log.logException(ex);
769             throw new Exception JavaDoc("Read-only table: DML operations not allowed");
770         }
771     }
772
773     public Site findSiteByID(String JavaDoc id, DBTransaction dbt) throws Exception JavaDoc {
774         SiteImpl site = null;
775         try {
776             SitesQuery query = new SitesQuery(dbt);
777             //set query
778
query.setQueryOId(new ObjectId(id));
779             // Throw an exception if more than one user by this name is found
780
query.requireUniqueInstance();
781             SitesDO sitesDO = query.getNextDO();
782             site = new SiteImpl(sitesDO, dbt);
783             return site;
784         } catch (Exception JavaDoc ex) {
785             Log.logException(ex);
786             throw new Exception JavaDoc("Exception in findDiscsByID()");
787         }
788     }
789
790     public Timestamp JavaDoc getLASTUPDATE() throws Exception JavaDoc {
791         try {
792             return sitesDO.getLASTUPDATE();
793         } catch (Exception JavaDoc ex) {
794             Log.logException(ex);
795             throw new Exception JavaDoc("Error getting lastupdate");
796         }
797     }
798
799     public Timestamp JavaDoc getLASTQUERY() throws Exception JavaDoc {
800         try {
801             return sitesDO.getLASTQUERY();
802         } catch (Exception JavaDoc ex) {
803             Log.logException(ex);
804             throw new Exception JavaDoc("Error getting lastquery");
805         }
806     }
807
808     public int getFILENR() throws Exception JavaDoc {
809         try {
810             return sitesDO.getFILENR();
811         } catch (Exception JavaDoc ex) {
812             Log.logException(ex);
813             throw new Exception JavaDoc("Error getting filenr");
814         }
815     }
816
817     public int getQUERYNR() throws Exception JavaDoc {
818         try {
819             return sitesDO.getQUERYNR();
820         } catch (Exception JavaDoc ex) {
821             Log.logException(ex);
822             throw new Exception JavaDoc("Error getting querynr");
823         }
824     }
825
826     public void setLASTUPDATE(Timestamp JavaDoc str) throws Exception JavaDoc {
827         try {
828             sitesDO.setLASTUPDATE(str);
829         } catch (Exception JavaDoc ex) {
830             Log.logException(ex);
831             throw new Exception JavaDoc("Error setting lastupdate", ex);
832         }
833     }
834
835     public void setLASTQUERY(Timestamp JavaDoc str) throws Exception JavaDoc {
836         try {
837             sitesDO.setLASTQUERY(str);
838         } catch (Exception JavaDoc ex) {
839             Log.logException(ex);
840             throw new Exception JavaDoc("Error setting lastupdate", ex);
841         }
842     }
843
844     public void setFILENR(int str) throws Exception JavaDoc {
845         try {
846             sitesDO.setFILENR(str);
847         } catch (Exception JavaDoc ex) {
848             Log.logException(ex);
849             throw new Exception JavaDoc("Error setting filenr", ex);
850         }
851
852     }
853
854     public void setQUERYNR(int str) throws Exception JavaDoc {
855         try {
856             sitesDO.setQUERYNR(str);
857         } catch (Exception JavaDoc ex) {
858             Log.logException(ex);
859             throw new Exception JavaDoc("Error setting querynr", ex);
860         }
861
862     }
863
864     public void deleteDir(String JavaDoc index) throws Exception JavaDoc {
865         try {
866             File JavaDoc dir = new File JavaDoc(Snapper.getIndexDir() + File.separator
867                     + index);
868             if (dir.exists()) {
869                 if (dir.canRead()) {
870                     if (dir.isDirectory()) {
871                         String JavaDoc[] files = dir.list();
872                         if (files != null) {
873                             for (int p = 0; p < files.length; p++) {
874                                 File JavaDoc originalFile = new File JavaDoc(dir, files[p]);
875                                 originalFile.delete();
876                             }
877                         }
878                         dir.delete();
879                     }
880                 }
881             }
882         } catch (Exception JavaDoc ex) {
883             Log.logException(ex);
884         }
885     }
886
887 }
Popular Tags