1 | public class Exists extends ResourceComparator {↵ | | 1 | public class Type extends ResourceComparator {↵
|
|
2 | /**↵ | | 2 | /**↵
|
3 | * Compare two Resources.↵ | | 3 | * Compare two Resources.↵
|
4 | * @param foo the first Resource.↵ | | 4 | * @param foo the first Resource.↵
|
5 | * @param bar the second Resource.↵ | | 5 | * @param bar the second Resource.↵
|
6 | * @return a negative integer, zero, or a positive integer as the first↵ | | 6 | * @return a negative integer, zero, or a positive integer as the first↵
|
7 | * argument is less than, equal to, or greater than the second.↵ | | 7 | * argument is less than, equal to, or greater than the second.↵
|
8 | */↵ | | 8 | */↵
|
9 | protected int resourceCompare(Resource foo, Resource bar) {↵ | | 9 | protected int resourceCompare(Resource foo, Resource bar) {↵
|
10 | boolean f = foo.isExists();↵ | | 10 | boolean f = foo.isDirectory();↵
|
11 | if (f == bar.isExists()) {↵ | | 11 | if (f == bar.isDirectory()) {↵
|
12 | return 0;↵ | | 12 | return 0;↵
|
13 | }↵ | | 13 | }↵
|
14 | return f ? 1 : -1;↵ | | 14 | return f ? 1 : -1;↵
|
15 | | | 15 |
|