151
|
1 /* Directory -- Filesystem directory object
|
149
|
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 * Created on 26.08.2003
|
|
20 *
|
|
21 */
|
|
22 package digilib.io;
|
|
23
|
|
24 import java.io.File;
|
|
25
|
|
26 /** Class for filesystem directories
|
|
27 * @author casties
|
|
28 *
|
|
29 */
|
|
30 public class Directory {
|
|
31 // File object pointing to the directory
|
|
32 File dir = null;
|
151
|
33 // parent directory
|
|
34 Directory parent = null;
|
149
|
35
|
|
36 /** Default constructor.
|
|
37 *
|
|
38 */
|
|
39 public Directory() {
|
|
40 super();
|
|
41 }
|
|
42
|
|
43 /** Constructor taking a File object.
|
|
44 *
|
|
45 * @param d
|
|
46 */
|
|
47 public Directory(File d) {
|
|
48 dir = d;
|
|
49 }
|
|
50
|
151
|
51 /** Constructor taking a File object and a parent.
|
|
52 *
|
|
53 * @param d
|
|
54 */
|
|
55 public Directory(File dir, Directory parent) {
|
|
56 this.dir = dir;
|
|
57 this.parent = parent;
|
|
58 }
|
|
59
|
149
|
60 /** Constructor taking a directory name.
|
|
61 *
|
|
62 * @param d
|
|
63 */
|
|
64 public Directory(String dn) {
|
|
65 dir = new File(dn);
|
|
66 }
|
|
67
|
|
68 /**
|
|
69 * @return
|
|
70 */
|
|
71 public File getDir() {
|
|
72 return dir;
|
|
73 }
|
|
74
|
|
75 /**
|
|
76 * @param dir
|
|
77 */
|
|
78 public void setDir(File dir) {
|
|
79 this.dir = dir;
|
|
80 }
|
151
|
81
|
|
82 /**
|
|
83 * @return
|
|
84 */
|
|
85 Directory getParent() {
|
|
86 return parent;
|
|
87 }
|
|
88
|
|
89 /**
|
|
90 * @param parent
|
|
91 */
|
|
92 void setParent(Directory parent) {
|
|
93 this.parent = parent;
|
|
94 }
|
|
95
|
149
|
96
|
|
97 }
|