01: /*
02: HttpdBase4J: An embeddable Java web server framework that supports HTTP, HTTPS,
03: templated content and serving content from inside a jar or archive.
04: Copyright (C) 2007 Donald Munro
05:
06: This library is free software; you can redistribute it and/or
07: modify it under the terms of the GNU Lesser General Public
08: License as published by the Free Software Foundation; either
09: version 2.1 of the License, or (at your option) any later version.
10:
11: This library is distributed in the hope that it will be useful,
12: but WITHOUT ANY WARRANTY; without even the implied warranty of
13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: Lesser General Public License for more details.
15:
16: You should have received a copy of the GNU Lesser General Public
17: License along with this library; if not,see http://www.gnu.org/licenses/lgpl.txt
18: */
19:
20: package net.homeip.donaldm.httpdbase4j;
21:
22: import java.io.InputStream;
23: import java.util.Date;
24:
25: /**
26: * The Request classes returns sortable lists of classes implementing the
27: * DirItemInterface to implement directory listings.
28: * @author Donald Munro
29: */
30: public interface DirItemInterface
31: //===============================
32: {
33: /**
34: * Used as a parameter to specify how the directory contents should be sorted
35: */
36: static public enum SORTBY {
37: NAME, SIZE, DATE
38: }
39:
40: /**
41: * @return The directory item name.
42: */
43: public String getName();
44:
45: /**
46: * @return The directory item size.
47: */
48: public long getSize();
49:
50: /**
51: * @return The directory item date.
52: */
53: public Date getDate();
54:
55: /**
56: * @return true if the directory item is a directory.
57: */
58: public boolean isDirectory();
59:
60: /**
61: *
62: * @return return an InputStream for the item, or return null
63: */
64: public InputStream getStream();
65: }
|