#22461 #1
|
@ -7,9 +7,11 @@ import java.util.List;
|
|||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Slf4j
|
||||
public class ConstraintCheck<T> {
|
||||
|
||||
public static <T> ConstraintCheck<T> defaultFor(T toCheck,T defaultValue){
|
||||
|
@ -55,6 +57,8 @@ public class ConstraintCheck<T> {
|
|||
T result=theObject;
|
||||
if(isError()) {
|
||||
result=theDefault;
|
||||
log.debug("Applying default {} for current value {}",theDefault,theObject);
|
||||
|
||||
if(theDefault!=null && theDefault instanceof Collection) {
|
||||
Collection defaultCollection=(Collection) theDefault;
|
||||
ArrayList target=new ArrayList(defaultCollection);
|
||||
|
|
|
@ -85,6 +85,8 @@ public class Files {
|
|||
}
|
||||
|
||||
public static String fixFilename(String toFix) {
|
||||
if(toFix.startsWith("\\."))
|
||||
toFix=toFix.replaceFirst("\\.","_");
|
||||
String extension="";
|
||||
if(toFix.contains(".")) {
|
||||
//preserve extension
|
||||
|
|
Loading…
Reference in New Issue