|
@@ -10,6 +10,7 @@ import lombok.experimental.UtilityClass;
|
|
|
import net.ranides.assira.collection.iterators.IterableUtils;
|
|
import net.ranides.assira.collection.iterators.IterableUtils;
|
|
|
import net.ranides.assira.collection.query.CQuery;
|
|
import net.ranides.assira.collection.query.CQuery;
|
|
|
import net.ranides.assira.functional.checked.CheckedSupplier;
|
|
import net.ranides.assira.functional.checked.CheckedSupplier;
|
|
|
|
|
+import net.ranides.assira.system.AssiraConfiguration;
|
|
|
import net.ranides.assira.text.Wildcard;
|
|
import net.ranides.assira.text.Wildcard;
|
|
|
|
|
|
|
|
import java.io.File;
|
|
import java.io.File;
|
|
@@ -33,12 +34,6 @@ import java.util.function.Supplier;
|
|
|
@UtilityClass
|
|
@UtilityClass
|
|
|
public class PathUtils {
|
|
public class PathUtils {
|
|
|
|
|
|
|
|
- // @todo #56
|
|
|
|
|
- private static final boolean WALKER_JDK7 = true;
|
|
|
|
|
-
|
|
|
|
|
- // @todo #56
|
|
|
|
|
- private static final boolean CASE_SENSITIVE_FILES = !new File( "a" ).equals( new File( "A" ) );
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* Creates Path from provided URL.
|
|
* Creates Path from provided URL.
|
|
|
*
|
|
*
|
|
@@ -220,7 +215,7 @@ public class PathUtils {
|
|
|
* @return boolean
|
|
* @return boolean
|
|
|
*/
|
|
*/
|
|
|
public static boolean hasExtension(String path, String extension) {
|
|
public static boolean hasExtension(String path, String extension) {
|
|
|
- if(CASE_SENSITIVE_FILES) {
|
|
|
|
|
|
|
+ if(AssiraConfiguration.CASE_SENSITIVE_FILES()) {
|
|
|
return path.endsWith(extension);
|
|
return path.endsWith(extension);
|
|
|
} else {
|
|
} else {
|
|
|
return path.toUpperCase(Locale.ROOT).endsWith(extension.toUpperCase(Locale.ROOT));
|
|
return path.toUpperCase(Locale.ROOT).endsWith(extension.toUpperCase(Locale.ROOT));
|
|
@@ -298,7 +293,7 @@ public class PathUtils {
|
|
|
* @return query
|
|
* @return query
|
|
|
*/
|
|
*/
|
|
|
public static CQuery<Path> list(Path dir) {
|
|
public static CQuery<Path> list(Path dir) {
|
|
|
- if(WALKER_JDK7) {
|
|
|
|
|
|
|
+ if(AssiraConfiguration.WALKER_JDK7()) {
|
|
|
return listJDK7(dir);
|
|
return listJDK7(dir);
|
|
|
} else {
|
|
} else {
|
|
|
return listJDK8(dir);
|
|
return listJDK8(dir);
|