🎨 Fix whitespace at EOF
[jSite.git] / src / main / java / de / todesbaum / util / freenet / fcp2 / DiskFileEntry.java
1 /*
2  * jSite - DiskFileEntry.java - Copyright Â© 2006–2019 David Roden
3  *
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.
8  *
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.
13  *
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.
17  */
18
19 package de.todesbaum.util.freenet.fcp2;
20
21 /**
22  * A {@link FileEntry} that reads the content from a file on the disk.
23  *
24  * @author David Roden <droden@gmail.com>
25  * @version $Id$
26  */
27 public class DiskFileEntry extends FileEntry {
28
29         /** The local file name. */
30         private final String localFilename;
31
32         /**
33          * Creates a new {@link FileEntry} with the specified name and content type
34          * that is read from the file specified by <code>localFilename</code>.
35          *
36          * @param filename
37          *            The name of the file
38          * @param contentType
39          *            The content type of the file
40          * @param localFilename
41          *            The name of the local file that holds the content of the file
42          *            to insert
43          */
44         public DiskFileEntry(String filename, String contentType, String localFilename) {
45                 super(filename, contentType);
46                 this.localFilename = localFilename;
47         }
48
49         /**
50          * {@inheritDoc}
51          */
52         @Override
53         public String getName() {
54                 return "disk";
55         }
56
57         /**
58          * Returns the name of the local file that holds the content for this file.
59          *
60          * @return The name of the local file
61          */
62         public String getLocalFilename() {
63                 return localFilename;
64         }
65
66 }