86
|
1 /* DocuFileset -- digilib image file info class.
|
|
2
|
|
3 Digital Image Library servlet components
|
|
4
|
|
5 Copyright (C) 2003 Robert Casties (robcast@mail.berlios.de)
|
|
6
|
|
7 This program is free software; you can redistribute it and/or modify it
|
|
8 under the terms of the GNU General Public License as published by the
|
|
9 Free Software Foundation; either version 2 of the License, or (at your
|
|
10 option) any later version.
|
|
11
|
|
12 Please read license.txt for the full details. A copy of the GPL
|
|
13 may be found at http://www.gnu.org/copyleft/lgpl.html
|
|
14
|
|
15 You should have received a copy of the GNU General Public License
|
|
16 along with this program; if not, write to the Free Software
|
|
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
18
|
|
19 */
|
|
20 package digilib.io;
|
|
21
|
|
22 import java.util.Collection;
|
|
23 import java.util.Hashtable;
|
|
24 import java.util.Vector;
|
|
25
|
|
26 /**
|
|
27 * @author casties
|
|
28 */
|
|
29 public class DocuFileset extends Vector {
|
|
30
|
|
31 // metadata
|
|
32 private Hashtable fileMeta = null;
|
|
33 // parent directory
|
|
34 private DocuDirectory parent = null;
|
|
35
|
|
36 public DocuFileset(int initialCapacity, int capacityIncrement) {
|
|
37 super(initialCapacity, capacityIncrement);
|
|
38 }
|
|
39
|
|
40 public DocuFileset(int initialCapacity) {
|
|
41 super(initialCapacity);
|
|
42 }
|
|
43
|
|
44 public DocuFileset() {
|
|
45 super();
|
|
46 }
|
|
47
|
|
48 public DocuFileset(Collection c) {
|
|
49 super(c);
|
|
50 }
|
|
51
|
|
52 /* (non-Javadoc)
|
|
53 * @see java.util.Collection#add(java.lang.Object)
|
|
54 */
|
|
55 public synchronized boolean add(DocuFile f) {
|
|
56 f.setParent(this);
|
|
57 return super.add(f);
|
|
58 }
|
|
59
|
|
60 public void readMeta() {
|
|
61 // check for file metadata...
|
|
62 }
|
|
63
|
|
64 public String getName() {
|
|
65 if (this.elementCount > 0) {
|
|
66 return ((DocuFile) firstElement()).getName();
|
|
67 }
|
|
68 return null;
|
|
69 }
|
|
70 /**
|
|
71 * @return DocuDirectory
|
|
72 */
|
|
73 public DocuDirectory getParent() {
|
|
74 return parent;
|
|
75 }
|
|
76
|
|
77 /**
|
|
78 * Sets the parent.
|
|
79 * @param parent The parent to set
|
|
80 */
|
|
81 public void setParent(DocuDirectory parent) {
|
|
82 this.parent = parent;
|
|
83 }
|
|
84
|
|
85 }
|