KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > raptus > owxv3 > api > GResFileLink


1 /*
2  * eAdmin/OWX
3  * Copyright (C) 1996-2003 OWX-Project Team <owx-team@gmx.net>
4  */

5
6 package com.raptus.owxv3.api;
7
8 import com.raptus.owxv3.Constants;
9
10 /**
11  *
12  * <hr>
13  * <table width="100%" border="0">
14  * <tr>
15  * <td width="24%"><b>Filename</b></td><td width="76%">GResFileLink.java</td>
16  * </tr>
17  * <tr>
18  * <td width="24%"><b>Author</b></td><td width="76%">REEA</td>
19  * </tr>
20  * <tr>
21  * <td width="24%"><b>Date</b></td><td width="76%">25th of September 2001</td>
22  * </tr>
23  * </table>
24  * <hr>
25  * <table width="100%" border="0">
26  * <tr>
27  * <td width="24%"><b>Date / Author</b></td><td width="76%"><b>Changes</b></td>
28  * </tr>
29  * </table>
30  * <hr>
31  * <table width="100%" border="0">
32  * <tr>
33  * <td>This class represents a link, i.e. a file assigment</td>
34  * </tr>
35  * </table>
36  * <hr>
37  */

38 public class GResFileLink extends Object JavaDoc
39 {
40     /**
41      *The file wich is linked
42      */

43     protected GResFile gresfile = null;
44
45
46     /**
47      *The table name to wich this file is linked
48      */

49     protected String JavaDoc srctable = null;
50
51     /**
52      *The owner VModule's name
53      */

54     protected String JavaDoc ownerVModule = null;
55
56
57     /**
58      *The id of this link
59      */

60     protected int linkid = 0;
61
62     /**
63      *Method for getting the rowId of the linked GResFile
64      */

65     public int getRowID() { return gresfile.getRowID(); }
66
67
68     /**
69      *Method for getting the usage count of the linked GResFile
70      */

71     public int getUsageCount() { return gresfile.getUsageCount(); }
72
73
74     /**
75      *Method for getting the filesize of the linked GResFile
76      */

77     public long getFileSize() { return gresfile.getFileSize(); }
78
79
80     /**
81      *Method for getting the url of the linked GResFile
82      */

83     public String JavaDoc getFileURL() { return gresfile.getFileURL(); }
84
85     /**
86      *Method for getting the category of the linked GResFile
87      */

88     public String JavaDoc getCategory() { return gresfile.getCategory(); }
89
90
91     /**
92      *Method for getting the type of the linked GResFile
93      */

94     public String JavaDoc getType() { return gresfile.getType(); }
95
96
97     /**
98      *Method for getting the info of the linked GResFile
99      */

100     public String JavaDoc getInfo() { return gresfile.getInfo(); }
101
102
103     /**
104      *Method for getting the filename from the fileUrl
105      */

106     public String JavaDoc getFileName(){
107         String JavaDoc fileURL=getFileURL();
108         if(fileURL.lastIndexOf(Constants.URL_SEPARATOR)==-1) return fileURL;
109         return fileURL.substring( fileURL.lastIndexOf(Constants.URL_SEPARATOR)+1 );
110     }
111
112
113     /**
114      *Method for determining that the file is picture or not
115      */

116     public boolean isPicture(){
117         return (gresfile instanceof com.raptus.owxv3.api.GResPicture);
118     }
119
120     /**
121      *Method for getting the picture width
122      */

123     public int getPictureWidth(){
124         if(! isPicture() ) return 0;
125         return ((com.raptus.owxv3.api.GResPicture)gresfile).getPictureWidth();
126     }
127
128     /**
129      *Method for getting the picture height
130      */

131     public int getPictureHeight(){
132         if(! isPicture() ) return 0;
133         return ((com.raptus.owxv3.api.GResPicture)gresfile).getPictureHeight();
134     }
135
136
137     /**
138      *Method for getting the source table
139      */

140     public String JavaDoc getSrctable() { return srctable; }
141
142     /**
143      *Method for setting the source table
144      */

145     public void setSrctable(String JavaDoc s) { this.srctable=s; }
146
147
148     /**
149      *Method for getting the owner VModule name
150      */

151     public String JavaDoc getOwnerVModule() { return ownerVModule; }
152
153     /**
154      *Method for setting the owner VModule name
155      */

156     public void setOwnerVModule(String JavaDoc s) { this.ownerVModule=s; }
157
158
159     /**
160      *Method for getting the id of the link
161      */

162     public int getLinkid() { return linkid; }
163
164     /**
165      *Method for setting the id of the link
166      */

167     public void setLinkid(int id) { this.linkid=id; }
168
169     /**
170      *Method for getting the associated GResFile object
171      */

172     public GResFile getGResFile() { return gresfile; }
173
174     /**
175      *Method for setting the associated GResFile object
176      */

177     public void setGResFile(GResFile file) { this.gresfile=file; }
178
179
180
181
182 }
183
184 /* end class GResFileLink */
185
186
Popular Tags