KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > jtrac > domain > Attachment


1 /*
2  * Copyright 2002-2005 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package info.jtrac.domain;
18
19 import java.io.Serializable JavaDoc;
20
21 /**
22  * Represents a file attachment. Files will be stored on the local
23  * file system, not within the database.
24  * When an Attachment is first uploaded and stored, it is prefixed
25  * with the value of the id generated on the database insert.
26  * This filePrefix property is stored separately to smoothly
27  * handle database migrations. So even if a database export-import
28  * changes the id column values, the files within the attachments
29  * folder can be used as is, without resorting to mass renaming.
30  */

31 public class Attachment implements Serializable JavaDoc {
32     
33     private long id;
34     private Attachment previous;
35     private long filePrefix;
36     private String JavaDoc fileName;
37     
38     public String JavaDoc getFileName() {
39         return fileName;
40     }
41
42     public void setFileName(String JavaDoc fileName) {
43         this.fileName = fileName;
44     }
45
46     public long getId() {
47         return id;
48     }
49
50     public void setId(long id) {
51         this.id = id;
52     }
53
54     public Attachment getPrevious() {
55         return previous;
56     }
57
58     public void setPrevious(Attachment previous) {
59         this.previous = previous;
60     }
61
62     public long getFilePrefix() {
63         return filePrefix;
64     }
65
66     public void setFilePrefix(long filePrefix) {
67         this.filePrefix = filePrefix;
68     }
69     
70 }
71
Popular Tags