|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.filechooser.FileFilter
biggests.utils.FileFilterDirectory
public class FileFilterDirectory
Title: File Filter with directory exclusion.
Description: Defines a file filter able to exclude specific directories from being shown to and selected by the user in a file chooser.
Copyright: Copyright (C) 2007 Joana Gonçalves 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 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.
Constructor Summary | |
---|---|
FileFilterDirectory(java.lang.String[] invalidDirectoryPaths,
java.lang.String validFileExtension)
Creates a new directory file filter, with a specific valid file extension and some invalid directory paths. |
Method Summary | |
---|---|
boolean |
accept(java.io.File file)
Checks if a certain file is acceptable under the filter conditions. |
java.lang.String |
checkAndAddFileExtension(java.lang.String filePath)
Checks if filePath has the required file
extension on it. |
java.lang.String |
getDescription()
Returns the description of this file filter. |
java.lang.String[] |
getInvalidDirectoryPaths()
Returns this file filter invalid directory paths. |
java.lang.String |
getValidFileExtension()
Returns this file filter valid file extension. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileFilterDirectory(java.lang.String[] invalidDirectoryPaths, java.lang.String validFileExtension) throws java.lang.Exception
invalidDirectoryPaths
- the String[]
list of
directory paths to prevent from user
selectionvalidFileExtension
- the valid file extension String
for the user to select
java.lang.Exception
- when the file extension is not validMethod Detail |
---|
public boolean accept(java.io.File file)
true
if file
is accepted, or
false
otherwise.
accept
in class javax.swing.filechooser.FileFilter
file
- the File
to check
boolean
which is true
if the file
is accepted or false
otherwisepublic java.lang.String getDescription()
getDescription
in class javax.swing.filechooser.FileFilter
String
description of this file filterpublic java.lang.String getValidFileExtension()
String
valid file extension for this file filterpublic java.lang.String[] getInvalidDirectoryPaths()
String[]
invalid directory paths for this file filterpublic java.lang.String checkAndAddFileExtension(java.lang.String filePath)
filePath
has the required file
extension on it. If not, adds the file extension to the
path and returns the new path.
filePath
- String
the file path to check
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |