public class DefaultFileFilter extends FileFilter
Constructor and Description |
---|
DefaultFileFilter()
Creates a file filter.
|
DefaultFileFilter(String extension)
Creates a file filter that accepts files with the given extension.
|
DefaultFileFilter(String[] filters)
Creates a file filter from the given string array.
|
DefaultFileFilter(String[] filters,
String description)
Creates a file filter from the given string array and description.
|
DefaultFileFilter(String extension,
String description)
Creates a file filter that accepts the given file type.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(File f)
Return true if this file should be shown in the directory pane, false if
it shouldn't.
|
void |
addExtension(String extension)
Adds a filetype "dot" extension to filter against.
|
String |
getDescription() |
String |
getExtension(File f)
Return the extension portion of the file's name.
|
static FileFilter |
getFileFilter() |
static FileFilter |
getFileFilterBinary() |
static FileFilter |
getFileFilterBMP() |
static FileFilter |
getFileFilterGIF() |
static FileFilter |
getFileFilterHDF4() |
static FileFilter |
getFileFilterHDF5() |
static FileFilter |
getFileFilterJPEG() |
static FileFilter |
getFileFilterPNG() |
static FileFilter |
getFileFilterText() |
static FileFilter |
getFileFilterTIFF() |
static byte[] |
getHDF5UserBlock(String filename)
Read HDF5 user block data into byte array.
|
static FileFilter |
getImageFileFilter() |
boolean |
isExtensionListInDescription() |
static boolean |
isHDF4(String filename)
look at the first 4 bytes of the file to see if it is an HDF4 file.
|
static boolean |
isHDF5(String filename)
look at the first 8 bytes of the file to see if it is an HDF5 file.
|
static boolean |
isNetcdf(String filename)
look at the first 4 bytes of the file to see if it is a netCDF file
byte[0]=67, byte[1]=68, byte[2]=70, byte[3]=1 or
|
void |
setDescription(String description)
Sets the human readable description of this filter.
|
void |
setExtensionListInDescription(boolean b)
Determines whether the extension list (.jpg, .gif, etc) should show up in
the human readable description.
|
static boolean |
setHDF5UserBlock(String fin,
String fout,
byte[] buf)
Write HDF5 user block data into byte array.
|
public DefaultFileFilter()
addExtension(java.lang.String)
public DefaultFileFilter(String extension)
extension
- the file extension to filter onaddExtension(java.lang.String)
public DefaultFileFilter(String extension, String description)
extension
- the file extension to filter ondescription
- the file extension full descriptionaddExtension(java.lang.String)
public DefaultFileFilter(String[] filters)
filters
- the list of filter namesaddExtension(java.lang.String)
public DefaultFileFilter(String[] filters, String description)
filters
- the list of filter namesdescription
- the name of the filter listaddExtension(java.lang.String)
public boolean accept(File f)
accept
in class FileFilter
getExtension(java.io.File)
public String getExtension(File f)
f
- The file to get the extension portion of the name forgetExtension(java.io.File)
,
FileFilter.accept(java.io.File)
public void addExtension(String extension)
extension
- the file extension to add to the file filterpublic String getDescription()
getDescription
in class FileFilter
public void setDescription(String description)
description
- the full description of the file filterpublic void setExtensionListInDescription(boolean b)
b
- the show state of the extension listpublic boolean isExtensionListInDescription()
public static FileFilter getFileFilter()
public static FileFilter getFileFilterHDF4()
public static FileFilter getFileFilterHDF5()
public static FileFilter getFileFilterJPEG()
public static FileFilter getFileFilterTIFF()
public static FileFilter getFileFilterPNG()
public static FileFilter getFileFilterBMP()
public static FileFilter getFileFilterGIF()
public static FileFilter getImageFileFilter()
public static FileFilter getFileFilterText()
public static FileFilter getFileFilterBinary()
public static boolean isHDF4(String filename)
filename
- The name of the file to checkpublic static boolean isHDF5(String filename)
filename
- The name of the file to checkpublic static boolean isNetcdf(String filename)
filename
- The name of the file to checkpublic static byte[] getHDF5UserBlock(String filename)
filename
- The name of the file to read the HDF5 user block frompublic static boolean setHDF5UserBlock(String fin, String fout, byte[] buf)
fin
- The name of the file to copy to the output filefout
- The name of the file to write HDF5 user block data tobuf
- The HDF5 user block data to write into the output fileCopyright © 2017. All Rights Reserved.