commit | author | age
|
332c05
|
1 |
/* |
U |
2 |
* To change this license header, choose License Headers in Project Properties. |
|
3 |
* To change this template file, choose Tools | Templates |
|
4 |
* and open the template in the editor. |
|
5 |
*/ |
|
6 |
package de.uhilger.filecms.pub; |
|
7 |
|
|
8 |
import de.uhilger.wbx.web.TNServlet; |
|
9 |
import java.io.File; |
|
10 |
import java.io.FileFilter; |
|
11 |
|
|
12 |
/** |
|
13 |
* |
|
14 |
* @author ulrich |
|
15 |
*/ |
|
16 |
public class ImgFileFilter implements FileFilter { |
|
17 |
@Override |
|
18 |
public boolean accept(File pathname) { |
|
19 |
boolean pass = true; |
|
20 |
String fname = pathname.getName().toLowerCase(); |
|
21 |
if(fname.endsWith(TNServlet.JPEG) || fname.endsWith(TNServlet.JPG) || fname.endsWith(TNServlet.PNG)) { |
|
22 |
if(fname.contains(TNServlet.GR) || fname.contains(TNServlet.KL) || fname.contains(TNServlet.MT) || |
|
23 |
fname.contains(TNServlet.SM) || fname.contains(TNServlet.TN)) { |
|
24 |
pass = false; |
|
25 |
} |
|
26 |
} |
|
27 |
return pass; |
|
28 |
} |
|
29 |
} |