984dcbecf63c1e56e09698646552f645393116b8
[jSite2.git] / src / net / pterodactylus / jsite / project / 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.project;
21
22 import java.util.List;
23
24 import net.pterodactylus.jsite.core.Core;
25
26 /**
27  * Abstraction for a that exists on the machine {@link Core} is being run on.
28  * This abstraction layer exists to make it possible to run jSite as a daemon
29  * and only connect to it via network.
30  * 
31  * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
32  */
33 public interface ProjectFile {
34
35         /**
36          * Returns the name of the file.
37          * 
38          * @return The name of the file
39          */
40         public String getName();
41
42         /**
43          * Returns all parent files of this file. This file is the last file in the
44          * returned list.
45          * 
46          * @return A list of all parents of this file and this file itself
47          */
48         public List<ProjectFile> getParents();
49
50         /**
51          * Returns whether this file is a directory.
52          * 
53          * @return <code>true</code> if this file is a directory,
54          *         <code>false</code> otherwise
55          */
56         public boolean isDirectory();
57
58         /**
59          * Returns whether this file is a file (as opposed to being a directory).
60          * 
61          * @return <code>true</code> if this file is a file, <code>false</code>
62          *         otherwise
63          */
64         public boolean isFile();
65
66         /**
67          * Returns whether this file is hidden.
68          * 
69          * @return <code>true</code> if this file is hidden
70          */
71         public boolean isHidden();
72
73         /**
74          * If this file is a directory, returns all files in this directory.
75          * 
76          * @see #isDirectory()
77          * @return All files in this directory if this file is a directory, or
78          *         <code>null</code> if this file is not a directory
79          */
80         public List<ProjectFile> getFiles();
81
82 }