|
17 | 17 | package org.springframework.core.io.support;
|
18 | 18 |
|
19 | 19 | import java.io.File;
|
| 20 | +import java.io.FileNotFoundException; |
20 | 21 | import java.io.IOException;
|
21 | 22 | import java.lang.reflect.InvocationHandler;
|
22 | 23 | import java.lang.reflect.Method;
|
@@ -697,10 +698,16 @@ protected Set<Resource> doFindPathMatchingFileResources(Resource rootDirResource
|
697 | 698 | try {
|
698 | 699 | rootDir = rootDirResource.getFile().getAbsoluteFile();
|
699 | 700 | }
|
700 |
| - catch (IOException ex) { |
| 701 | + catch (FileNotFoundException ex) { |
| 702 | + if (logger.isDebugEnabled()) { |
| 703 | + logger.debug("Cannot search for matching files underneath " + rootDirResource + |
| 704 | + " in the file system: " + ex.getMessage()); |
| 705 | + } |
| 706 | + return Collections.emptySet(); |
| 707 | + } |
| 708 | + catch (Exception ex) { |
701 | 709 | if (logger.isInfoEnabled()) {
|
702 |
| - logger.info("Cannot search for matching files underneath " + rootDirResource + |
703 |
| - " because it does not correspond to a directory in the file system", ex); |
| 710 | + logger.info("Failed to resolve " + rootDirResource + " in the file system: " + ex); |
704 | 711 | }
|
705 | 712 | return Collections.emptySet();
|
706 | 713 | }
|
@@ -755,7 +762,7 @@ protected Set<File> retrieveMatchingFiles(File rootDir, String pattern) throws I
|
755 | 762 | }
|
756 | 763 | if (!rootDir.canRead()) {
|
757 | 764 | if (logger.isInfoEnabled()) {
|
758 |
| - logger.info("Cannot search for matching files underneath directory [" + rootDir.getAbsolutePath() + |
| 765 | + logger.info("Skipping search for matching files underneath directory [" + rootDir.getAbsolutePath() + |
759 | 766 | "] because the application is not allowed to read the directory");
|
760 | 767 | }
|
761 | 768 | return Collections.emptySet();
|
|
0 commit comments