01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc;
05:
06: import java.io.File;
07:
08: import javax.swing.filechooser.FileFilter;
09:
10: public class WebAppFileFilter extends FileFilter {
11: private static final String WEB_APP_FILE_EXT = ".war";
12: private static final String DESCRIPTION = "J2EE webapps";
13:
14: public static WebAppFileFilter m_instance;
15:
16: public static WebAppFileFilter getInstance() {
17: if (m_instance == null) {
18: m_instance = new WebAppFileFilter();
19: }
20: return m_instance;
21: }
22:
23: public boolean accept(File f) {
24: return f.isDirectory()
25: || f.getName().endsWith(WEB_APP_FILE_EXT);
26: }
27:
28: public String getDescription() {
29: return DESCRIPTION;
30: }
31: }
|