/*
* Copyright (C) 2010 Brockmann Consult GmbH (info@brockmann-consult.de)
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 3 of the License, or (at your option)
* any later version.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, see http://www.gnu.org/licenses/
*/
package org.esa.snap.ui;
import java.io.File;
/**
* <code>FileHistory</code> is a fixed-size array for the pathes of files opened/saved by a user. If a new file is added
* and the file history is full, the list of registered files is shifted so that the oldest file path is beeing
* skipped..
*
* @author Norman Fomferra
* @version $Revision$ $Date$
*/
public class FileHistory extends UserInputHistory {
public FileHistory(int maxNumEntries, String propertyKey) {
super(maxNumEntries, propertyKey);
}
@Override
protected boolean isValidItem(String item) {
if (item != null && item.length() > 0) {
return new File(item).exists();
}
return false;
}
}