public enum FindOption extends Enum<FindOption> implements Option, FindOptions
find
command.
For most applications, it may be more convenient to use Find.Options
instead of the option constants defined here.
-d | --typeDirectory | Consider only directories | |||
-f | --typeFile | Consider only regular files | |||
-l | --typeSymlink | Consider only symbolic links | |||
-x | --typeOther | Consider only files that are neither of directory (d), regular file (f) or symlink (l). | |||
-r | --regex | Use full regular expression syntax for the patterns specified by the
name operand
(This option is ignored if no name operand is specified). | |||
-i | --ignoreCase | Use case insensitive matching when applying the file name pattern
specified by the name operand
(This option is ignored if no name operand is specified). | |||
-n | --timeNewer | Consider only files that have been created, modified or accessed
after or at the time specified by the time operand (the default)
(This option is ignored if no time operand is specified). | |||
-o | --timeOlder | Consider only files that have been created, modified or accessed
before or at the time specified by the time operand
(This option is ignored if no time operand is specified). | |||
-c | --timeCreate | The time operand refers to the creation time of the file
(This option is ignored if no time operand is specified). | |||
-a | --timeAccess | The time operand refers to the last access time of the file
(This option is ignored if no time operand is specified). | |||
-m | --timeModified | The time operand refers to the last modification time of the file
(the default)
(This option is ignored if no time operand is specified). | |||
-z | --print0 | Print the full file name on the standard output, followed by a null character (instead of the newline character used by default). This allows file names that contain newlines or other types of white space to be correctly interpreted by programs that process the find output. This option corresponds to the --delimiter0 option of xargs. |
FindOptions.Default
Enum Constant and Description |
---|
ignoreCase
Option
--ignoreCase , -i :
Use case insensitive matching when applying the file name pattern
specified by the name operand |
print0
Option
--print0 , -z :
Print the full file name on the standard output, followed by a null
character (instead of the newline character used by default). |
regex
Option
--regex , -r :
Use full regular expression syntax for the patterns specified by the
name operand |
timeAccess
Option
--timeAccess , -a :
The time operand refers to the last access time of the file |
timeCreate
Option
--timeCreate , -c :
The time operand refers to the creation time of the file |
timeModified
Option
--timeModified , -m :
The time operand refers to the last modification time of the file
(the default) |
timeNewer
Option
--timeNewer , -n :
Consider only files that have been created, modified or accessed
after or at the time specified by the time operand (the default) |
timeOlder
Option
--timeOlder , -o :
Consider only files that have been created, modified or accessed
before or at the time specified by the time operand |
typeDirectory
Option
--typeDirectory , -d :
Consider only directories |
typeFile
Option
--typeFile , -f :
Consider only regular files |
typeOther
Option
--typeOther , -x :
Consider only files that are neither of directory (d),
regular file (f) or symlink (l). |
typeSymlink
Option
--typeSymlink , -l :
Consider only symbolic links |
CONVERTER, EMPTY
Modifier and Type | Method and Description |
---|---|
char |
acronym()
Returns a one letter acronym for this option.
|
EnumSet<FindOption> |
asSet()
Returns a new set with
this active option. |
static FindOption |
findByAcronym(char acronym)
Returns the option with the given
acronym , or null if no
such option is found. |
boolean |
isSet(FindOption option)
Returns true if the specified
option is set and false otherwise |
Iterator<FindOption> |
iterator()
Returns an immutable iterator returning o single element:
this
option. |
Class<FindOption> |
optionType()
Returns the option type class, usually an enum.
|
int |
size()
Returns 1 as this is a set with a single element:
this option |
boolean |
useAcronymFor(FindOption option)
Returns true if the
acronym should be used for
the specified option in string representations. |
static FindOption |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static FindOption[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
forEach, spliterator
public static final FindOption typeDirectory
--typeDirectory
, -d
:
Consider only directoriespublic static final FindOption typeFile
--typeFile
, -f
:
Consider only regular filespublic static final FindOption typeSymlink
--typeSymlink
, -l
:
Consider only symbolic linkspublic static final FindOption typeOther
--typeOther
, -x
:
Consider only files that are neither of directory (d),
regular file (f) or symlink (l).public static final FindOption regex
--regex
, -r
:
Use full regular expression syntax for the patterns specified by the
name operand
(This option is ignored if no name operand is specified).
public static final FindOption ignoreCase
--ignoreCase
, -i
:
Use case insensitive matching when applying the file name pattern
specified by the name operand
(This option is ignored if no name operand is specified).
public static final FindOption timeNewer
--timeNewer
, -n
:
Consider only files that have been created, modified or accessed
after or at the time specified by the time operand (the default)
(This option is ignored if no time operand is specified).
public static final FindOption timeOlder
--timeOlder
, -o
:
Consider only files that have been created, modified or accessed
before or at the time specified by the time operand
(This option is ignored if no time operand is specified).
public static final FindOption timeCreate
--timeCreate
, -c
:
The time operand refers to the creation time of the file
(This option is ignored if no time operand is specified).
public static final FindOption timeAccess
--timeAccess
, -a
:
The time operand refers to the last access time of the file
(This option is ignored if no time operand is specified).
public static final FindOption timeModified
--timeModified
, -m
:
The time operand refers to the last modification time of the file
(the default)
(This option is ignored if no time operand is specified).
public static final FindOption print0
--print0
, -z
:
Print the full file name on the standard output, followed by a null
character (instead of the newline character used by default). This
allows file names that contain newlines or other types of white
space to be correctly interpreted by programs that process the find
output. This option corresponds to the --delimiter0 option of xargs.public static FindOption[] values()
for (FindOption c : FindOption.values()) System.out.println(c);
public static FindOption valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic Class<FindOption> optionType()
OptionSet
optionType
in interface OptionSet<FindOption>
public static FindOption findByAcronym(char acronym)
acronym
, or null
if no
such option is found.acronym
- the option acronym
acronym
or null
if it
is not foundpublic char acronym()
Option
public boolean isSet(FindOption option)
OptionSet
option
is set and false otherwiseisSet
in interface OptionSet<FindOption>
option
- the option to testoption
is set in this OptionSet
public EnumSet<FindOption> asSet()
this
active option.asSet
in interface OptionSet<FindOption>
public Iterator<FindOption> iterator()
this
option.iterator
in interface Iterable<FindOption>
iterator
in interface OptionSet<FindOption>
this
active option.public int size()
this
optionsize
in interface OptionSet<FindOption>
public boolean useAcronymFor(FindOption option)
acronym
should be used for
the specified option
in string representations.
This method returns always true for all options.
useAcronymFor
in interface OptionSet<FindOption>
option
- the option of interestCopyright © 2024. All rights reserved.