2 * jSite - FileEntry.java - Copyright © 2006–2019 David Roden
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 package de.todesbaum.util.freenet.fcp2;
22 * Abstract base class of file entries that are used in the
23 * {@link de.todesbaum.util.freenet.fcp2.ClientPutComplexDir} command to define
24 * the files of an insert.
26 * @author David Roden <droden@gmail.com>
29 public abstract class FileEntry {
31 /** The name of the file. */
32 private final String filename;
34 /** The content type of the file. */
35 private final String contentType;
38 * Creates a new file entry with the specified name and content type. The
39 * content type should be a standard MIME type with an additional charset
40 * specification for text-based types.
43 * The name of the file
45 * The content type of the file, e.g.
46 * <code>"application/x-tar"</code> or
47 * <code>"text/html; charset=iso8859-15"</code>
49 protected FileEntry(String filename, String contentType) {
50 this.filename = filename;
51 this.contentType = contentType;
55 * Returns the name of this entry's type. Can be one of <code>direct</code>,
56 * <code>disk</code>, or <code>redirect</code>. This method is
57 * implemented by the subclasses {@link DirectFileEntry},
58 * {@link DiskFileEntry}, and {@link RedirectFileEntry}, respectively.
60 * @return The name of this entry's type
62 public abstract String getName();
65 * Returns the content type of this file.
67 * @return The content type of this file
69 public String getContentType() {
74 * Returns the name of this file.
76 * @return The name of this file
78 public String getFilename() {