本文整理汇总了Java中org.apache.commons.io.IOCase.SENSITIVE属性的典型用法代码示例。如果您正苦于以下问题:Java IOCase.SENSITIVE属性的具体用法?Java IOCase.SENSITIVE怎么用?Java IOCase.SENSITIVE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.commons.io.IOCase
的用法示例。
在下文中一共展示了IOCase.SENSITIVE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: equals
/**
* Checks whether two filenames are equal, optionally normalizing and providing
* control over the case-sensitivity.
*
* @param filename1 the first filename to query, may be null
* @param filename2 the second filename to query, may be null
* @param normalized whether to normalize the filenames
* @param caseSensitivity what case sensitivity rule to use, null means case-sensitive
* @return true if the filenames are equal, null equals null
* @since 1.3
*/
public static boolean equals(
String filename1, String filename2,
boolean normalized, IOCase caseSensitivity) {
if (filename1 == null || filename2 == null) {
return filename1 == null && filename2 == null;
}
if (normalized) {
filename1 = normalize(filename1);
filename2 = normalize(filename2);
if (filename1 == null || filename2 == null) {
throw new NullPointerException(
"Error normalizing one or both of the file names");
}
}
if (caseSensitivity == null) {
caseSensitivity = IOCase.SENSITIVE;
}
return caseSensitivity.checkEquals(filename1, filename2);
}
示例2: searchPrefixFile
/**
* 查找需要合并文件的临时文件信息
*
* @param directory 临时文件所在的目录
* @param prefix 临时文件的前缀
* @param caseSensitivity 临时文件的大小写敏感
* @return collection
*/
public static Collection<File> searchPrefixFile(File directory, String prefix, boolean
caseSensitivity) {
IOCase iocase = IOCase.INSENSITIVE;
if (caseSensitivity) {
iocase = IOCase.SENSITIVE;
}
//创建相关的过滤器
IOFileFilter fileFilter = FileFilterUtils.prefixFileFilter(prefix, iocase);
//检查相关的过滤信息
return FileUtils.listFiles(directory, fileFilter, FalseFileFilter.INSTANCE);
}
示例3: WildcardFileFilter
/**
* Construct a new wildcard filter for a single wildcard specifying case-sensitivity.
*
* @param wildcard the wildcard to match, not null
* @param caseSensitivity how to handle case sensitivity, null means case-sensitive
* @throws IllegalArgumentException if the pattern is null
*/
public WildcardFileFilter(String wildcard, IOCase caseSensitivity) {
if (wildcard == null) {
throw new IllegalArgumentException("The wildcard must not be null");
}
this.wildcards = new String[] { wildcard };
this.caseSensitivity = caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity;
}
示例4: NameFileFilter
/**
* Constructs a new name file filter for an array of names specifying case-sensitivity.
*
* @param names the names to allow, must not be null
* @param caseSensitivity how to handle case sensitivity, null means case-sensitive
* @throws IllegalArgumentException if the names array is null
*/
public NameFileFilter(final String[] names, final IOCase caseSensitivity) {
if (names == null) {
throw new IllegalArgumentException("The array of names must not be null");
}
this.names = new String[names.length];
System.arraycopy(names, 0, this.names, 0, names.length);
this.caseSensitivity = caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity;
}
示例5: WildcardFileFilter
/**
* Construct a new wildcard filter for an array of wildcards specifying case-sensitivity.
* <p>
*
* @param wildcards the array of wildcards to match, not null
* @param caseSensitivity how to handle case sensitivity, null means case-sensitive
* @throws IllegalArgumentException if the pattern array is null
*/
public WildcardFileFilter(final String[] wildcards, final IOCase caseSensitivity) {
if (wildcards == null) {
throw new IllegalArgumentException("The wildcard array must not be null");
}
this.wildcards = new String[wildcards.length];
System.arraycopy(wildcards, 0, this.wildcards, 0, wildcards.length);
this.caseSensitivity = caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity;
}
示例6: NameFileFilter
/**
* Construct a new name file filter specifying case-sensitivity.
*
* @param name the name to allow, must not be null
* @param caseSensitivity how to handle case sensitivity, null means case-sensitive
* @throws IllegalArgumentException if the name is null
*/
public NameFileFilter(String name, IOCase caseSensitivity) {
if (name == null) {
throw new IllegalArgumentException("The wildcard must not be null");
}
this.names = new String[] {name};
this.caseSensitivity = caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity;
}
示例7: WildcardFileFilter
/**
* Construct a new wildcard filter for a single wildcard specifying case-sensitivity.
*
* @param wildcard the wildcard to match, not null
* @param caseSensitivity how to handle case sensitivity, null means case-sensitive
* @throws IllegalArgumentException if the pattern is null
*/
public WildcardFileFilter(String wildcard, IOCase caseSensitivity) {
if (wildcard == null) {
throw new IllegalArgumentException("The wildcard must not be null");
}
this.wildcards = new String[] { wildcard };
this.caseSensitivity = (caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity);
}
示例8: NameFileComparator
/**
* Construct a case sensitive file name comparator instance.
*/
public NameFileComparator() {
this.caseSensitivity = IOCase.SENSITIVE;
}
示例9: PathFileComparator
/**
* Construct a case sensitive file path comparator instance.
*/
public PathFileComparator() {
this.caseSensitivity = IOCase.SENSITIVE;
}
示例10: ExtensionFileComparator
/**
* Construct a case sensitive file extension comparator instance.
*/
public ExtensionFileComparator() {
this.caseSensitivity = IOCase.SENSITIVE;
}
示例11: PrefixFileFilter
/**
* Constructs a new Prefix file filter for a single prefix
* specifying case-sensitivity.
*
* @param prefix the prefix to allow, must not be null
* @param caseSensitivity how to handle case sensitivity, null means case-sensitive
* @throws IllegalArgumentException if the prefix is null
* @since 1.4
*/
public PrefixFileFilter(String prefix, IOCase caseSensitivity) {
if (prefix == null) {
throw new IllegalArgumentException("The prefix must not be null");
}
this.prefixes = new String[] {prefix};
this.caseSensitivity = caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity;
}
示例12: PrefixFileFilter
/**
* Constructs a new Prefix file filter for a single prefix
* specifying case-sensitivity.
*
* @param prefix the prefix to allow, must not be null
* @param caseSensitivity how to handle case sensitivity, null means case-sensitive
* @throws IllegalArgumentException if the prefix is null
* @since Commons IO 1.4
*/
public PrefixFileFilter(String prefix, IOCase caseSensitivity) {
if (prefix == null) {
throw new IllegalArgumentException("The prefix must not be null");
}
this.prefixes = new String[] {prefix};
this.caseSensitivity = (caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity);
}
示例13: SuffixFileFilter
/**
* Constructs a new Suffix file filter for a list of suffixes
* specifying case-sensitivity.
*
* @param suffixes the suffixes to allow, must not be null
* @param caseSensitivity how to handle case sensitivity, null means case-sensitive
* @throws IllegalArgumentException if the suffix list is null
* @throws ClassCastException if the list does not contain Strings
* @since 1.4
*/
public SuffixFileFilter(List<String> suffixes, IOCase caseSensitivity) {
if (suffixes == null) {
throw new IllegalArgumentException("The list of suffixes must not be null");
}
this.suffixes = suffixes.toArray(new String[suffixes.size()]);
this.caseSensitivity = caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity;
}
示例14: NameFileFilter
/**
* Constructs a new name file filter for a list of names specifying case-sensitivity.
*
* @param names the names to allow, must not be null
* @param caseSensitivity how to handle case sensitivity, null means case-sensitive
* @throws IllegalArgumentException if the name list is null
* @throws ClassCastException if the list does not contain Strings
*/
public NameFileFilter(List<String> names, IOCase caseSensitivity) {
if (names == null) {
throw new IllegalArgumentException("The list of names must not be null");
}
this.names = names.toArray(new String[names.size()]);
this.caseSensitivity = (caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity);
}
示例15: SuffixFileFilter
/**
* Constructs a new Suffix file filter for a list of suffixes
* specifying case-sensitivity.
*
* @param suffixes the suffixes to allow, must not be null
* @param caseSensitivity how to handle case sensitivity, null means case-sensitive
* @throws IllegalArgumentException if the suffix list is null
* @throws ClassCastException if the list does not contain Strings
* @since Commons IO 1.4
*/
public SuffixFileFilter(List<String> suffixes, IOCase caseSensitivity) {
if (suffixes == null) {
throw new IllegalArgumentException("The list of suffixes must not be null");
}
this.suffixes = suffixes.toArray(new String[suffixes.size()]);
this.caseSensitivity = (caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity);
}