2 * jSite2 - ProjectFile.java -
3 * Copyright © 2008 David Roden
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.
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.
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.
20 package net.pterodactylus.jsite.project;
23 import java.util.List;
25 import net.pterodactylus.jsite.core.Core;
28 * Abstraction for a that exists on the machine {@link Core} is being run on.
29 * This abstraction layer exists to make it possible to run jSite as a daemon
30 * and only connect to it via network.
32 * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
34 public interface ProjectFile {
37 * Returns the name of the file.
39 * @return The name of the file
41 public String getName();
44 * Returns the parent of this project file.
46 * @return The parent of this project file, or <code>null</code> if this
47 * project file does not have a parent
49 public ProjectFile getParent();
52 * Returns all parent files of this file. This file is the last file in the
55 * @return A list of all parents of this file and this file itself
57 public List<ProjectFile> getParents();
60 * Returns the complete path of this file, without a leading
61 * {@link File#separator}.
63 * @return The complete path of this file
65 public String getCompletePath();
68 * Returns the size of the file. If this file is a directory, the returned
69 * value is unspecified.
72 * @return The size of the file
74 public long getSize();
77 * Returns whether this file is a directory.
79 * @return <code>true</code> if this file is a directory,
80 * <code>false</code> otherwise
82 public boolean isDirectory();
85 * Returns whether this file is a file (as opposed to being a directory).
87 * @return <code>true</code> if this file is a file, <code>false</code>
90 public boolean isFile();
93 * Returns whether this file is hidden.
95 * @return <code>true</code> if this file is hidden
97 public boolean isHidden();
100 * If this file is a directory, returns all files in this directory.
102 * @see #isDirectory()
103 * @return All files in this directory if this file is a directory, or
104 * <code>null</code> if this file is not a directory
106 public List<ProjectFile> getFiles();