Skip to content

Commit c1463ef

Browse files
author
Gary Gregory
committed
Refactor common code into a private method.
1 parent f6655cf commit c1463ef

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/main/java/org/apache/commons/io/filefilter/PrefixFileFilter.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,15 @@ public boolean accept(final File file) {
149149
return accept(file.getName());
150150
}
151151

152+
private boolean accept(final String name) {
153+
for (final String prefix : prefixes) {
154+
if (caseSensitivity.checkStartsWith(name, prefix)) {
155+
return true;
156+
}
157+
}
158+
return false;
159+
}
160+
152161
/**
153162
* Checks to see if the file name starts with the prefix.
154163
*
@@ -161,15 +170,6 @@ public boolean accept(final File file, final String name) {
161170
return accept(name);
162171
}
163172

164-
private boolean accept(final String name) {
165-
for (final String prefix : prefixes) {
166-
if (caseSensitivity.checkStartsWith(name, prefix)) {
167-
return true;
168-
}
169-
}
170-
return false;
171-
}
172-
173173
/**
174174
* Provide a String representation of this file filter.
175175
*

0 commit comments

Comments
 (0)