@@ -504,7 +504,7 @@ impl ObjectStore for LocalFileSystem {
504
504
505
505
match config. filesystem_to_path ( entry. path ( ) ) {
506
506
Ok ( path) => match is_valid_file_path ( & path) {
507
- true => Some ( convert_entry ( entry, path) ) ,
507
+ true => convert_entry ( entry, path) . transpose ( ) ,
508
508
false => None ,
509
509
} ,
510
510
Err ( e) => Some ( Err ( e) ) ,
@@ -581,8 +581,8 @@ impl ObjectStore for LocalFileSystem {
581
581
582
582
if is_directory {
583
583
common_prefixes. insert ( prefix. child ( common_prefix) ) ;
584
- } else {
585
- objects. push ( convert_entry ( entry , entry_location ) ? ) ;
584
+ } else if let Some ( metadata ) = convert_entry ( entry , entry_location ) ? {
585
+ objects. push ( metadata ) ;
586
586
}
587
587
}
588
588
}
@@ -894,12 +894,21 @@ fn open_file(path: &PathBuf) -> Result<(File, Metadata)> {
894
894
Ok ( ret)
895
895
}
896
896
897
- fn convert_entry ( entry : DirEntry , location : Path ) -> Result < ObjectMeta > {
898
- let metadata = entry. metadata ( ) . map_err ( |e| Error :: Metadata {
899
- source : e. into ( ) ,
900
- path : location. to_string ( ) ,
901
- } ) ?;
902
- convert_metadata ( metadata, location)
897
+ fn convert_entry ( entry : DirEntry , location : Path ) -> Result < Option < ObjectMeta > > {
898
+ match entry. metadata ( ) {
899
+ Ok ( metadata) => convert_metadata ( metadata, location) . map ( Some ) ,
900
+ Err ( e) => {
901
+ if let Some ( io_err) = e. io_error ( ) {
902
+ if io_err. kind ( ) == ErrorKind :: NotFound {
903
+ return Ok ( None ) ;
904
+ }
905
+ }
906
+ Err ( Error :: Metadata {
907
+ source : e. into ( ) ,
908
+ path : location. to_string ( ) ,
909
+ } ) ?
910
+ }
911
+ }
903
912
}
904
913
905
914
fn last_modified ( metadata : & Metadata ) -> DateTime < Utc > {
0 commit comments