3 * Copyright (C) 2006 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 de.todesbaum.util.freenet.fcp2;
23 * Abstract base class of file entries that are used in the
24 * {@link de.todesbaum.util.freenet.fcp2.ClientPutComplexDir} command to define
25 * the files of an insert.
27 * @author David Roden <droden@gmail.com>
30 public abstract class FileEntry {
32 /** The name of the file. */
33 private final String filename;
35 /** The content type of the file. */
36 private final String contentType;
39 * Creates a new file entry with the specified name and content type. The
40 * content type should be a standard MIME type with an additional charset
41 * specification for text-based types.
44 * The name of the file
46 * The content type of the file, e.g.
47 * <code>"application/x-tar"</code> or
48 * <code>"text/html; charset=iso8859-15"</code>
50 protected FileEntry(String filename, String contentType) {
51 this.filename = filename;
52 this.contentType = contentType;
56 * Returns the name of this entry's type. Can be one of <code>direct</code>,
57 * <code>disk</code>, or <code>redirect</code>. This method is
58 * implemented by the subclasses {@link DirectFileEntry},
59 * {@link DiskFileEntry}, and {@link RedirectFileEntry}, respectively.
61 * @return The name of this entry's type
63 public abstract String getName();
66 * Returns the content type of this file.
68 * @return The content type of this file
70 public String getContentType() {
75 * Returns the name of this file.
77 * @return The name of this file
79 public String getFilename() {