Child: [85c2d9] (diff)

Download this file

ThinDocStructure.java    89 lines (69 with data), 1.8 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package de.kuei.metafora.gwt.smack.shared;
import java.io.Serializable;
import com.google.gwt.user.client.rpc.IsSerializable;
public class ThinDocStructure implements Serializable, IsSerializable {
/**
* This class represents a document in the couchDB and serves the transport
* of information about the corresponding document in the couchDB from the
* server to the client
*/
private static final long serialVersionUID = -2390885606058308353L;
private String urlPrefix = "workbench/development/fileupload?id=";
String docname;
String url;
String docId;
String time;
public ThinDocStructure(){
}
public ThinDocStructure(String server) {
urlPrefix = server+urlPrefix;
}
/**
* Creates a ThinDocStructure with this ID, name and time
*
* @param docId
* ID of the document
* @param docname
* filename of the document
* @param time
* time stamp of the document
*/
public ThinDocStructure(String docId, String docname, String time, String server) {
urlPrefix = server+urlPrefix;
this.docId = docId;
this.docname = docname;
url = urlPrefix + docId;
this.time = time;
}
public String getDocname() {
return docname;
}
public void setDocname(String docname) {
this.docname = docname;
}
public String getUrl() {
return url;
}
private void setUrl(String id) {
this.url = urlPrefix + id;
}
public String getDocId() {
return docId;
}
/**
* Sets the docId of this ThinDocStructure and updates its URL
*
* @param docId
* the ID of the document
*/
public void setDocId(String docId) {
this.docId = docId;
setUrl(docId);
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
}