proceed in case of resolution failure for a single resource entry in the list

This commit is contained in:
Juergen Hoeller 2010-01-18 18:27:30 +00:00
parent c31f245dc9
commit 7097a9e965
1 changed files with 9 additions and 2 deletions

View File

@ -23,6 +23,9 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.core.io.Resource;
import org.springframework.util.SystemPropertyUtils;
@ -50,6 +53,8 @@ import org.springframework.util.SystemPropertyUtils;
*/
public class ResourceArrayPropertyEditor extends PropertyEditorSupport {
private static final Log logger = LogFactory.getLog(ResourceArrayPropertyEditor.class);
private final ResourcePatternResolver resourcePatternResolver;
private final boolean ignoreUnresolvablePlaceholders;
@ -122,8 +127,10 @@ public class ResourceArrayPropertyEditor extends PropertyEditorSupport {
}
}
catch (IOException ex) {
throw new IllegalArgumentException(
"Could not resolve resource location pattern [" + pattern + "]: " + ex.getMessage());
// ignore - might be an unresolved placeholder or non-existing base directory
if (logger.isDebugEnabled()) {
logger.debug("Could not retrieve resources for pattern '" + pattern + "': " + ex);
}
}
}
else if (element instanceof Resource) {