KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > geinuke > bizlogic > UploadFileBL


1
2  /*
3  -- GeiNuke --
4 Copyright (c) 2005 by Roberto Sidoti [geinuke@users.sourceforge.net]
5  http://www.hostingjava.it/-geinuke/
6
7 This file is part of GeiNuke.
8
9     GeiNuke is free software; you can redistribute it and/or modify
10     it under the terms of the GNU General Public License as published by
11     the Free Software Foundation; either version 2 of the License, or
12     (at your option) any later version.
13
14     GeiNuke is distributed in the hope that it will be useful,
15     but WITHOUT ANY WARRANTY; without even the implied warranty of
16     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17     GNU General Public License for more details.
18
19     You should have received a copy of the GNU General Public License
20     along with GeiNuke; if not, write to the Free Software
21     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */

23 package com.geinuke.bizlogic;
24
25 import java.sql.SQLException JavaDoc;
26 import java.util.ArrayList JavaDoc;
27 import java.util.List JavaDoc;
28
29 import com.geinuke.dao.UploadFileDAO;
30 import com.geinuke.middle.IUploadFileBL;
31 import com.geinuke.vo.UploadFileVO;
32
33
34 public class UploadFileBL implements IUploadFileBL {
35     protected static IUploadFileBL instance=null;
36     
37     public UploadFileBL(){
38         
39     }
40     
41     
42     
43     public ArrayList JavaDoc getUploadFilesByUID(int uid) throws BLException{
44         ArrayList JavaDoc ll=null;
45         try{
46             UploadFileDAO dao=new UploadFileDAO();
47             List JavaDoc list=dao.getUploadFilesByUID(uid);
48             
49             ll=new ArrayList JavaDoc(list);
50             
51         }catch(SQLException JavaDoc sqle){
52             throw new DBException(sqle.getMessage());
53         }catch(Throwable JavaDoc t){
54             throw new BLException(t.getMessage());
55         }
56         return ll;
57     }
58     
59     
60     
61     public UploadFileVO getUploadFileByUFID(int fid) throws BLException{
62         UploadFileVO ll=null;
63         try{
64             UploadFileDAO dao=new UploadFileDAO();
65             ll=dao.getUploadFileByUFID(fid);
66             
67             
68             
69         }catch(SQLException JavaDoc sqle){
70             throw new DBException(sqle.getMessage());
71         }catch(Throwable JavaDoc t){
72             throw new BLException(t.getMessage());
73         }
74         return ll;
75     }
76     
77     public void deleteUploadFileByUFID(int fid) throws BLException{
78         
79         try{
80             UploadFileDAO dao=new UploadFileDAO();
81             dao.deleteUploadFileByUFID(fid);
82             
83         }catch(SQLException JavaDoc sqle){
84             throw new DBException(sqle.getMessage());
85         }catch(Throwable JavaDoc t){
86             throw new BLException(t.getMessage());
87         }
88         
89     }
90     
91     
92     public void insUploadFile(UploadFileVO wf)throws BLException{
93         
94         try{
95             UploadFileDAO dao=new UploadFileDAO();
96             dao.insertUploadFile(wf);
97             
98         }catch(SQLException JavaDoc sqle){
99             throw new DBException(sqle.getMessage());
100         }catch(Throwable JavaDoc t){
101             throw new BLException(t.getMessage());
102         }
103         
104     }
105     
106
107
108 }
109
110
Popular Tags