/*
|
neon-fm - File management extensions to Neon
|
Copyright (C) 2024 Ulrich Hilger
|
|
This program is free software: you can redistribute it and/or modify
|
it under the terms of the GNU Affero 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 Affero General Public License for more details.
|
|
You should have received a copy of the GNU Affero General Public License
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
*/
|
package de.uhilger.fm;
|
|
import java.io.File;
|
import java.io.FileFilter;
|
|
/**
|
* Ein Filter zum Auslassen kleiner Versionen einer Original-Bilddatei
|
*
|
* @author Ulrich Hilger
|
* @version 1, 12. Mai 2021
|
*/
|
public class ImageFileFilter implements FileFilter {
|
@Override
|
public boolean accept(File pathname) {
|
boolean pass = true;
|
String fname = pathname.getName().toLowerCase();
|
if(fname.endsWith(Const.JPEG) ||
|
fname.endsWith(Const.JPG) || fname.endsWith(Const.PNG)) {
|
if(fname.contains(Const.GR) || fname.contains(Const.KL) ||
|
fname.contains(Const.MT) || fname.contains(Const.SM) ||
|
fname.contains(Const.TN) || fname.contains(Const.B64)) {
|
pass = false;
|
}
|
}
|
return pass;
|
}
|
}
|