ewe.util
Class FileComparer
java.lang.Object
ewe.util.FileComparer
- All Implemented Interfaces:
- Comparer
- public class FileComparer
- extends Object
- implements Comparer
A FileComparer compares two File objects according to criteria which include:
name, length, type and modification date.
ForwardSlash
public static char ForwardSlash
BackSlash
public static char BackSlash
DriveSeparator
public static char DriveSeparator
MySeparator
public static char MySeparator
IGNORE_CASE
public static final int IGNORE_CASE
- See Also:
- Constant Field Values
mask
protected String mask
parent
protected File parent
options
protected int options
check1
protected File check1
check2
protected File check2
locale
protected Locale locale
time
protected Time time
caseSensitive
public boolean caseSensitive
letAll
public boolean letAll
FileComparer
public FileComparer(File parent,
Locale locale,
int options,
String mask)
- Parameters:
parent - The parent file for the files to be compared.locale - a Locale to use for comparisons.options - This should be the File.LIST_XXX options.mask - An optional mask for comparing a File with a mask.
setMask
public void setMask(String mask)
compare
public int compare(Object one,
Object two)
- Description copied from interface:
Comparer
- This should compare the two objects and return:
0 = the objects are equal.
greater than 0 = one is greater than two.
less than 0 = two is greater than one.
- Specified by:
compare in interface Comparer
findLastSeparatorDrive
protected static int findLastSeparatorDrive(String full)
findLastSeparator
public static int findLastSeparator(String full)
getExt
public static String getExt(String full)
getFile
public static String getFile(String full)
matches
public boolean matches(String fileName)
accept
public boolean accept(File dir,
Object nameOrFile)
getDrivePath
public static String getDrivePath(String full)
getFileExt
public static String getFileExt(String full)