whitespace fixups
[jSite2.git] / src / net / pterodactylus / jsite / core / ProjectFile.java
1 /*
2  * jSite2 - ProjectFile.java -
3  * Copyright © 2008 David Roden
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
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 net.pterodactylus.jsite.core;
21
22 import java.io.File;
23 import java.util.List;
24
25 /**
26  * Abstraction for a that exists on the machine {@link Core} is being run on.
27  * This abstraction layer exists to make it possible to run jSite as a daemon
28  * and only connect to it via network.
29  *
30  * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
31  */
32 public interface ProjectFile {
33
34         /**
35          * Returns the name of the file.
36          *
37          * @return The name of the file
38          */
39         public String getName();
40
41         /**
42          * Returns the parent of this project file.
43          *
44          * @return The parent of this project file, or <code>null</code> if this
45          *         project file does not have a parent
46          */
47         public ProjectFile getParent();
48
49         /**
50          * Returns all parent files of this file. This file is the last file in the
51          * returned list.
52          *
53          * @return A list of all parents of this file and this file itself
54          */
55         public List<ProjectFile> getParents();
56
57         /**
58          * Returns the complete path of this file, without a leading
59          * {@link File#separator}.
60          *
61          * @return The complete path of this file
62          */
63         public String getCompletePath();
64
65         /**
66          * Returns the size of the file. If this file is a directory, the returned
67          * value is unspecified.
68          *
69          * @see File#length()
70          * @return The size of the file
71          */
72         public long getSize();
73
74         /**
75          * Returns whether this file is a directory.
76          *
77          * @return <code>true</code> if this file is a directory,
78          *         <code>false</code> otherwise
79          */
80         public boolean isDirectory();
81
82         /**
83          * Returns whether this file is a file (as opposed to being a directory).
84          *
85          * @return <code>true</code> if this file is a file, <code>false</code>
86          *         otherwise
87          */
88         public boolean isFile();
89
90         /**
91          * Returns whether this file is hidden.
92          *
93          * @return <code>true</code> if this file is hidden
94          */
95         public boolean isHidden();
96
97         /**
98          * If this file is a directory, returns all files in this directory.
99          *
100          * @see #isDirectory()
101          * @return All files in this directory if this file is a directory, or
102          *         <code>null</code> if this file is not a directory
103          */
104         public List<ProjectFile> getFiles();
105
106 }