KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > snipsnap > snip > attachment > Attachment


1 /*
2  * This file is part of "SnipSnap Wiki/Weblog".
3  *
4  * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel
5  * All Rights Reserved.
6  *
7  * Please visit http://snipsnap.org/ for updates and contact.
8  *
9  * --LICENSE NOTICE--
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23  * --LICENSE NOTICE--
24  */

25
26 package org.snipsnap.snip.attachment;
27
28 import org.snipsnap.snip.SnipLink;
29
30 import java.util.Date JavaDoc;
31
32 /**
33  * Class for grouping and managing attachments for a snip
34  *
35  * @author Matthias L. Jugel
36  * @version $Id: Attachment.java 1606 2004-05-17 10:56:18Z leo $
37  */

38
39 public class Attachment {
40
41   private String JavaDoc name;
42   private String JavaDoc contentType;
43   private long size;
44   private Date JavaDoc date;
45   private String JavaDoc location;
46
47   public Attachment(String JavaDoc name, String JavaDoc contentType, long size, Date JavaDoc date, String JavaDoc location) {
48     setName(name);
49     setContentType(contentType);
50     setSize(size);
51     setDate(date);
52     setLocation(location);
53   }
54
55   public void setName(String JavaDoc name) {
56     this.name = name;
57   }
58
59   public String JavaDoc getName() {
60     return name;
61   }
62
63   public String JavaDoc getNameEncoded() {
64     return SnipLink.encode(name);
65   }
66
67   public void setContentType(String JavaDoc contentType) {
68     this.contentType = contentType;
69   }
70
71   public String JavaDoc getContentType() {
72     return contentType;
73   }
74
75   public void setSize(long size) {
76     this.size = size;
77   }
78
79   public long getSize() {
80     return size;
81   }
82
83   public void setDate(Date JavaDoc date) {
84     this.date = date;
85   }
86
87   public Date JavaDoc getDate() {
88     return date;
89   }
90
91   public void setLocation(String JavaDoc location) {
92     this.location = location;
93   }
94
95   public String JavaDoc getLocation() {
96     return location;
97   }
98 }
99
Popular Tags