commit | author | age
|
e369b9
|
1 |
/* |
U |
2 |
neon-fm - File management extensions to Neon |
|
3 |
Copyright (C) 2024 Ulrich Hilger |
|
4 |
|
|
5 |
This program is free software: you can redistribute it and/or modify |
|
6 |
it under the terms of the GNU Affero General Public License as |
|
7 |
published by the Free Software Foundation, either version 3 of the |
|
8 |
License, or (at your option) any later version. |
|
9 |
|
|
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 Affero General Public License for more details. |
|
14 |
|
|
15 |
You should have received a copy of the GNU Affero General Public License |
|
16 |
along with this program. If not, see <https://www.gnu.org/licenses/>. |
|
17 |
*/ |
|
18 |
package de.uhilger.fm; |
|
19 |
|
|
20 |
import java.io.File; |
|
21 |
import java.io.FileFilter; |
|
22 |
|
|
23 |
/** |
|
24 |
* Ein Filter zum Auslassen kleiner Versionen einer Original-Bilddatei |
|
25 |
* |
|
26 |
* @author Ulrich Hilger |
|
27 |
* @version 1, 12. Mai 2021 |
|
28 |
*/ |
|
29 |
public class ImageFileFilter implements FileFilter { |
|
30 |
@Override |
|
31 |
public boolean accept(File pathname) { |
|
32 |
boolean pass = true; |
|
33 |
String fname = pathname.getName().toLowerCase(); |
|
34 |
if(fname.endsWith(Const.JPEG) || |
|
35 |
fname.endsWith(Const.JPG) || fname.endsWith(Const.PNG)) { |
|
36 |
if(fname.contains(Const.GR) || fname.contains(Const.KL) || |
|
37 |
fname.contains(Const.MT) || fname.contains(Const.SM) || |
|
38 |
fname.contains(Const.TN) || fname.contains(Const.B64)) { |
|
39 |
pass = false; |
|
40 |
} |
|
41 |
} |
|
42 |
return pass; |
|
43 |
} |
|
44 |
} |
|
45 |
|