1 /*
2 * $Id: AbstractGHEntry.java 2993 2011-11-24 19:51:48Z andrewinkler $
3 * ============================================================================
4 * Project gluehloch-homepage-core
5 * Copyright (c) 2004-2007 by Andre Winkler. All rights reserved.
6 * ============================================================================
7 * GNU LESSER GENERAL PUBLIC LICENSE
8 * TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
9 *
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 */
25
26 package de.awtools.homegen.directory.utils;
27
28 import org.apache.commons.io.FileUtils;
29
30 import de.awtools.homegen.directory.GHEntry;
31
32 /**
33 * Utility Klasse für alle {@link GHEntry} Implementierungen.
34 *
35 * @version $LastChangedRevision: 2993 $ $LastChangedDate: 2011-11-24 20:51:48 +0100 (Thu, 24 Nov 2011) $
36 * @author by Andre Winkler, $LastChangedBy: andrewinkler $
37 */
38 public abstract class AbstractGHEntry implements GHEntry {
39
40 /**
41 * Prüft, ob das übergebene {@link GHEntry} ein jüngeres Erstellungsdatum
42 * besitzt. Falls <code>null</code> als Parameter übergeben wird, wird
43 * immer <code>true</code> zurück geliefert. D.h. dieses Objekt ist
44 * immer neuer als nichts!
45 *
46 * @param _file Mit diesem {@link GHEntry} findet der Vergleich statt.
47 * @return Liefert <code>true</code>, wenn das übergebene {@link GHEntry}
48 * ein jüngeres Erstellungsdatum besitzt.
49 */
50 @Override
51 public final boolean isNewer(final GHEntry _file) {
52 boolean result = true;
53 if (_file != null) {
54 result = FileUtils.isFileNewer(getFile(), _file.getFile());
55 }
56 return result;
57 }
58
59 }