1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.vfs2.impl;
18
19 import java.io.File;
20 import java.lang.reflect.Constructor;
21 import java.net.URI;
22 import java.net.URISyntaxException;
23 import java.net.URL;
24 import java.net.URLStreamHandler;
25 import java.net.URLStreamHandlerFactory;
26 import java.util.ArrayList;
27 import java.util.Arrays;
28 import java.util.Collection;
29 import java.util.HashMap;
30 import java.util.List;
31 import java.util.Map;
32
33 import org.apache.commons.logging.Log;
34 import org.apache.commons.logging.LogFactory;
35 import org.apache.commons.vfs2.CacheStrategy;
36 import org.apache.commons.vfs2.Capability;
37 import org.apache.commons.vfs2.FileContentInfoFactory;
38 import org.apache.commons.vfs2.FileName;
39 import org.apache.commons.vfs2.FileObject;
40 import org.apache.commons.vfs2.FileSystem;
41 import org.apache.commons.vfs2.FileSystemConfigBuilder;
42 import org.apache.commons.vfs2.FileSystemException;
43 import org.apache.commons.vfs2.FileSystemManager;
44 import org.apache.commons.vfs2.FileSystemOptions;
45 import org.apache.commons.vfs2.FileType;
46 import org.apache.commons.vfs2.FilesCache;
47 import org.apache.commons.vfs2.NameScope;
48 import org.apache.commons.vfs2.VFS;
49 import org.apache.commons.vfs2.cache.SoftRefFilesCache;
50 import org.apache.commons.vfs2.operations.FileOperationProvider;
51 import org.apache.commons.vfs2.provider.AbstractFileName;
52 import org.apache.commons.vfs2.provider.AbstractFileProvider;
53 import org.apache.commons.vfs2.provider.DefaultURLStreamHandler;
54 import org.apache.commons.vfs2.provider.FileProvider;
55 import org.apache.commons.vfs2.provider.FileReplicator;
56 import org.apache.commons.vfs2.provider.LocalFileProvider;
57 import org.apache.commons.vfs2.provider.TemporaryFileStore;
58 import org.apache.commons.vfs2.provider.UriParser;
59 import org.apache.commons.vfs2.provider.VfsComponent;
60
61
62
63
64 public class DefaultFileSystemManager implements FileSystemManager {
65
66
67
68
69 final class VfsStreamHandlerFactory implements URLStreamHandlerFactory {
70 @Override
71 public URLStreamHandler createURLStreamHandler(final String protocol) {
72 final FileProvider provider = providers.get(protocol);
73 if (provider != null) {
74 return new DefaultURLStreamHandler(context);
75 }
76
77
78 return new URLStreamHandlerProxy();
79 }
80 }
81
82
83
84
85 private final Map<String, FileProvider> providers = new HashMap<>();
86
87
88
89
90 private final List<String> virtualFileSystemSchemes = new ArrayList<>();
91
92
93
94
95 private final ArrayList<Object> components = new ArrayList<>();
96
97
98
99
100 private final DefaultVfsComponentContextntContext.html#DefaultVfsComponentContext">DefaultVfsComponentContext context = new DefaultVfsComponentContext(this);
101
102
103
104
105 private final Map<String, List<FileOperationProvider>> operationProviders = new HashMap<>();
106
107
108
109
110 private final FileTypeMapleTypeMap.html#FileTypeMap">FileTypeMap typeMap = new FileTypeMap();
111
112
113
114
115 private LocalFileProvider localFileProvider;
116
117
118
119
120 private FileProvider defaultProvider;
121
122
123
124
125 private FileReplicator fileReplicator;
126
127
128
129
130 private FileObject baseFile;
131
132
133
134
135 private FilesCache filesCache;
136
137
138
139
140 private CacheStrategy fileCacheStrategy;
141
142
143
144 private Class<?> fileObjectDecorator;
145
146
147
148
149 private Constructor<?> fileObjectDecoratorConst;
150
151
152
153
154 private FileContentInfoFactory fileContentInfoFactory;
155
156
157
158
159 private Log log = LogFactory.getLog(getClass());
160
161
162
163
164 private TemporaryFileStore tempFileStore;
165
166
167
168
169 private VirtualFileProvider vfsProvider;
170
171
172
173
174 private boolean init;
175
176
177
178
179
180
181
182
183
184 public void _closeFileSystem(final FileSystem fileSystem) {
185 final FileProvider provider = providers.get(fileSystem.getRootName().getScheme());
186 if (provider != null) {
187 ((AbstractFileProvider) provider).closeFileSystem(fileSystem);
188 } else if (fileSystem instanceof VirtualFileSystem) {
189
190 vfsProvider.closeFileSystem(fileSystem);
191 }
192 }
193
194
195
196
197
198
199
200 public void addExtensionMap(final String extension, final String scheme) {
201 typeMap.addExtension(extension, scheme);
202 }
203
204
205
206
207
208
209
210 public void addMimeTypeMap(final String mimeType, final String scheme) {
211 typeMap.addMimeType(mimeType, scheme);
212 }
213
214
215
216
217
218
219
220
221
222
223 @Override
224 public void addOperationProvider(final String scheme, final FileOperationProvider operationProvider)
225 throws FileSystemException {
226 addOperationProvider(new String[] { scheme }, operationProvider);
227 }
228
229
230
231
232
233
234
235
236 @Override
237 public void addOperationProvider(final String[] schemes, final FileOperationProvider operationProvider)
238 throws FileSystemException {
239 for (final String scheme : schemes) {
240 if (!operationProviders.containsKey(scheme)) {
241 final List<FileOperationProvider> providers = new ArrayList<>();
242 operationProviders.put(scheme, providers);
243 }
244
245 final List<FileOperationProvider> providers = operationProviders.get(scheme);
246
247 if (providers.contains(operationProvider)) {
248 throw new FileSystemException("vfs.operation/operation-provider-already-added.error", scheme);
249 }
250
251 setupComponent(operationProvider);
252
253 providers.add(operationProvider);
254 }
255 }
256
257
258
259
260
261
262
263
264
265
266
267
268 public void addProvider(final String urlScheme, final FileProvider provider) throws FileSystemException {
269 addProvider(new String[] { urlScheme }, provider);
270 }
271
272
273
274
275
276
277
278
279
280
281
282
283 public void addProvider(final String[] urlSchemes, final FileProvider provider) throws FileSystemException {
284
285 for (final String scheme : urlSchemes) {
286 if (providers.containsKey(scheme)) {
287 throw new FileSystemException("vfs.impl/multiple-providers-for-scheme.error", scheme);
288 }
289 }
290
291
292 setupComponent(provider);
293
294
295 Arrays.stream(urlSchemes).forEach(scheme -> providers.put(scheme, provider));
296
297 if (provider instanceof LocalFileProvider && localFileProvider == null) {
298 localFileProvider = (LocalFileProvider) provider;
299 }
300 }
301
302 protected void addVirtualFileSystemScheme(String rootUri) {
303 if (rootUri.indexOf(':') != -1) {
304 rootUri = rootUri.substring(0, rootUri.indexOf(':'));
305 }
306 virtualFileSystemSchemes.add(rootUri);
307 }
308
309
310
311
312
313
314
315
316 @Override
317 public boolean canCreateFileSystem(final FileObject file) throws FileSystemException {
318 return typeMap.getScheme(file) != null;
319 }
320
321
322
323
324
325
326
327
328
329
330
331 @Override
332 public void close() {
333 if (!init) {
334 return;
335 }
336
337
338
339
340
341
342 providers.values().forEach(this::closeComponent);
343
344
345 closeComponent(vfsProvider);
346 closeComponent(fileReplicator);
347 closeComponent(tempFileStore);
348 closeComponent(defaultProvider);
349
350
351
352 providers.clear();
353
354
355 operationProviders.values().forEach(opProviders -> opProviders.forEach(this::closeComponent));
356
357
358 operationProviders.clear();
359
360
361 typeMap.clear();
362
363
364 closeComponent(filesCache);
365
366
367 if (!components.isEmpty()) {
368 log.warn("DefaultFilesystemManager.close: not all components are closed: " + components.toString());
369 }
370 components.clear();
371
372
373 vfsProvider = null;
374
375
376 virtualFileSystemSchemes.clear();
377
378
379 defaultProvider = null;
380 baseFile = null;
381 fileObjectDecorator = null;
382 fileObjectDecoratorConst = null;
383 localFileProvider = null;
384 fileReplicator = null;
385 tempFileStore = null;
386
387 filesCache = null;
388 fileCacheStrategy = null;
389 fileContentInfoFactory = null;
390
391 init = false;
392 }
393
394
395
396
397
398
399 private void closeComponent(final Object component) {
400 if (component != null && components.contains(component)) {
401 if (component instanceof VfsComponent) {
402 ((VfsComponent) component).close();
403 }
404 components.remove(component);
405 }
406 }
407
408
409
410
411
412
413
414
415
416 @Override
417 public void closeFileSystem(final FileSystem fileSystem) {
418
419 getFilesCache().clear(fileSystem);
420
421
422 _closeFileSystem(fileSystem);
423 }
424
425
426
427
428
429
430
431
432 @Override
433 public FileObject#FileObject">FileObject createFileSystem(final FileObject file) throws FileSystemException {
434 final String scheme = typeMap.getScheme(file);
435 FileSystemException.requireNonNull(scheme, "vfs.impl/no-provider-for-file.error", file);
436 return createFileSystem(scheme, file);
437 }
438
439
440
441
442
443
444
445
446
447 @Override
448 public FileObject createFileSystem(FileObject="jxr_keyword">final String scheme, final FileObject file) throws FileSystemException {
449 final FileProvider provider = providers.get(scheme);
450 FileSystemException.requireNonNull(provider, "vfs.impl/unknown-provider.error", scheme, file);
451 return provider.createFileSystem(scheme, file, file.getFileSystem().getFileSystemOptions());
452 }
453
454
455
456
457
458
459
460
461 @Override
462 public FileObjectject">FileObject createVirtualFileSystem(final FileObject rootFile) throws FileSystemException {
463 final FileObject fileObject = vfsProvider.createFileSystem(rootFile);
464 addVirtualFileSystemScheme(rootFile.getName().getScheme());
465 return fileObject;
466 }
467
468
469
470
471
472
473
474
475 @Override
476 public FileObject createVirtualFileSystem(final String rootUri) throws FileSystemException {
477 final FileObject fileObject = vfsProvider.createFileSystem(rootUri);
478 addVirtualFileSystemScheme(rootUri);
479 return fileObject;
480 }
481
482
483
484
485 public void freeUnusedResources() {
486 if (!init) {
487 return;
488 }
489
490
491 for (final FileProvider fileProvider : providers.values()) {
492 if (fileProvider instanceof AbstractFileProvider) {
493 ((AbstractFileProvider) fileProvider).freeUnusedResources();
494 }
495 }
496
497 }
498
499
500
501
502
503
504
505 @Override
506 public FileObject getBaseFile() throws FileSystemException {
507 return baseFile;
508 }
509
510
511
512
513
514
515 @Override
516 public CacheStrategy getCacheStrategy() {
517 return fileCacheStrategy;
518 }
519
520
521
522
523
524
525 @Override
526 public FileContentInfoFactory getFileContentInfoFactory() {
527 return fileContentInfoFactory;
528 }
529
530
531
532
533
534
535 @Override
536 public Class<?> getFileObjectDecorator() {
537 return fileObjectDecorator;
538 }
539
540
541
542
543
544
545 @Override
546 public Constructor<?> getFileObjectDecoratorConst() {
547 return fileObjectDecoratorConst;
548 }
549
550
551
552
553
554
555 @Override
556 public FilesCache getFilesCache() {
557 return filesCache;
558 }
559
560
561
562
563
564
565
566
567 @Override
568 public FileSystemConfigBuilder getFileSystemConfigBuilder(final String scheme) throws FileSystemException {
569 final FileProvider provider = providers.get(scheme);
570 FileSystemException.requireNonNull(provider, "vfs.impl/unknown-scheme.error", scheme);
571 return provider.getConfigBuilder();
572 }
573
574
575
576
577
578
579
580
581
582
583
584 private LocalFileProvider getLocalFileProvider() throws FileSystemException {
585 return FileSystemException.requireNonNull(localFileProvider, "vfs.impl/no-local-file-provider.error");
586 }
587
588
589
590
591
592
593 protected Log getLogger() {
594 return log;
595 }
596
597
598
599
600
601
602
603
604
605 @Override
606 public FileOperationProvider[] getOperationProviders(final String scheme) throws FileSystemException {
607
608 final List<?> providers = operationProviders.get(scheme);
609 if (providers == null || providers.isEmpty()) {
610 return null;
611 }
612 return providers.toArray(FileOperationProvider.EMPTY_ARRAY);
613 }
614
615
616
617
618
619
620
621
622 @Override
623 public Collection<Capability> getProviderCapabilities(final String scheme) throws FileSystemException {
624 final FileProvider provider = providers.get(scheme);
625 FileSystemException.requireNonNull(provider, "vfs.impl/unknown-scheme.error", scheme);
626 return provider.getCapabilities();
627 }
628
629
630
631
632
633
634
635 public FileReplicator getReplicator() throws FileSystemException {
636 return FileSystemException.requireNonNull(fileReplicator, "vfs.impl/no-replicator.error");
637 }
638
639
640
641
642
643
644 @Override
645 public String[] getSchemes() {
646 final List<String> schemes = new ArrayList<>(providers.size() + virtualFileSystemSchemes.size());
647 schemes.addAll(providers.keySet());
648 schemes.addAll(virtualFileSystemSchemes);
649 return schemes.toArray(new String[]{});
650 }
651
652
653
654
655
656
657
658 public TemporaryFileStore getTemporaryFileStore() throws FileSystemException {
659 return FileSystemException.requireNonNull(tempFileStore, "vfs.impl/no-temp-file-store.error");
660 }
661
662
663
664
665
666
667 @Override
668 public URLStreamHandlerFactory getURLStreamHandlerFactory() {
669 return new VfsStreamHandlerFactory();
670 }
671
672
673
674
675
676
677
678 @Override
679 public boolean hasProvider(final String scheme) {
680 return providers.containsKey(scheme);
681 }
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696 public void init() throws FileSystemException {
697 if (fileContentInfoFactory == null) {
698 fileContentInfoFactory = new FileContentInfoFilenameFactory();
699 }
700
701 if (filesCache == null) {
702 filesCache = new SoftRefFilesCache();
703 }
704 if (fileCacheStrategy == null) {
705 fileCacheStrategy = CacheStrategy.ON_RESOLVE;
706 }
707 setupComponent(filesCache);
708
709 vfsProvider = new VirtualFileProvider();
710 setupComponent(vfsProvider);
711
712 init = true;
713 }
714
715
716
717
718
719
720
721 public void removeProvider(final String urlScheme) {
722 final FileProvider provider = providers.remove(urlScheme);
723
724 if (provider != null && !providers.containsValue(provider)) {
725 closeComponent(provider);
726 }
727 }
728
729
730
731
732
733
734
735
736
737
738
739 @Override
740 public FileObject resolveFile(final File baseFile, final String uri) throws FileSystemException {
741 return resolveFile(getLocalFileProvider().findLocalFile(baseFile), uri);
742 }
743
744
745
746
747
748
749
750
751
752 @Override
753 public FileObject.html#FileObject">FileObject resolveFile(final FileObject baseFile, final String uri) throws FileSystemException {
754 return resolveFile(baseFile, uri, baseFile == null ? null : baseFile.getFileSystem().getFileSystemOptions());
755 }
756
757
758
759
760
761
762
763
764
765
766 public FileObject.html#FileObject">FileObject resolveFile(final FileObject baseFile, final String uri,
767 final FileSystemOptions fileSystemOptions) throws FileSystemException {
768 final FileObject realBaseFile;
769 if (baseFile != null && VFS.isUriStyle() && baseFile.getName().isFile()) {
770 realBaseFile = baseFile.getParent();
771 } else {
772 realBaseFile = baseFile;
773 }
774
775
776 UriParser.checkUriEncoding(uri);
777
778 if (uri == null) {
779 throw new IllegalArgumentException();
780 }
781
782
783 final String scheme = UriParser.extractScheme(getSchemes(), uri);
784 if (scheme != null) {
785
786 final FileProvider provider = providers.get(scheme);
787 if (provider != null) {
788 return provider.findFile(realBaseFile, uri, fileSystemOptions);
789 }
790
791 }
792
793
794 if (localFileProvider != null && localFileProvider.isAbsoluteLocalName(uri)) {
795 return localFileProvider.findLocalFile(uri);
796 }
797
798 if (scheme != null) {
799
800 FileSystemException.requireNonNull(defaultProvider, "vfs.impl/unknown-scheme.error", scheme, uri);
801 return defaultProvider.findFile(realBaseFile, uri, fileSystemOptions);
802 }
803
804
805 FileSystemException.requireNonNull(realBaseFile, "vfs.impl/find-rel-file.error", uri);
806
807 return realBaseFile.resolveFile(uri);
808 }
809
810
811
812
813
814
815
816
817 @Override
818 public FileObject resolveFile(final String uri) throws FileSystemException {
819 return resolveFile(getBaseFile(), uri);
820 }
821
822
823
824
825
826
827
828
829
830
831 @Override
832 public FileObject resolveFile(final String uri, final FileSystemOptions fileSystemOptions)
833 throws FileSystemException {
834
835 return resolveFile(getBaseFile(), uri, fileSystemOptions);
836 }
837
838
839
840
841
842
843
844
845
846 @Override
847 public FileObject resolveFile(final URI uri) throws FileSystemException {
848
849 return resolveFile(baseFile, uri.toString(), null);
850 }
851
852
853
854
855
856
857
858
859
860 @Override
861 public FileObject resolveFile(final URL url) throws FileSystemException {
862 try {
863 return this.resolveFile(url.toURI());
864 } catch (final URISyntaxException e) {
865 throw new FileSystemException(e);
866 }
867 }
868
869
870
871
872
873
874
875
876
877
878
879 @Override
880 public FileName.html#FileName">FileName resolveName(final FileName root, final String path) throws FileSystemException {
881 return resolveName(root, path, NameScope.FILE_SYSTEM);
882 }
883
884
885
886
887
888
889
890
891
892
893
894 @Override
895 public FileName.html#FileName">FileName resolveName(final FileName base, final String name, final NameScope scope)
896 throws FileSystemException {
897 FileSystemException.requireNonNull(base, "Invalid base FileName.");
898 FileSystemException.requireNonNull(name, "Invalid name FileName.");
899 final FileName realBase;
900 if (VFS.isUriStyle() && base.isFile()) {
901 realBase = base.getParent();
902 } else {
903 realBase = base;
904 }
905
906 final StringBuilder buffer = new StringBuilder(name);
907
908
909 UriParser.fixSeparators(buffer);
910 String scheme = UriParser.extractScheme(getSchemes(), buffer.toString());
911
912
913 if (name.isEmpty() || (scheme == null && buffer.charAt(0) != FileName.SEPARATOR_CHAR)) {
914
915 if (!VFS.isUriStyle()) {
916
917 buffer.insert(0, FileName.SEPARATOR_CHAR);
918 }
919 buffer.insert(0, realBase.getPath());
920 }
921
922
923 final FileType fileType = UriParser.normalisePath(buffer);
924
925
926 final String resolvedPath = buffer.toString();
927 if (!AbstractFileName.checkName(realBase.getPath(), resolvedPath, scope)) {
928 throw new FileSystemException("vfs.provider/invalid-descendent-name.error", name);
929 }
930
931 final String fullPath;
932 if (scheme != null) {
933 fullPath = resolvedPath;
934 } else {
935 scheme = realBase.getScheme();
936 fullPath = realBase.getRootURI() + resolvedPath;
937 }
938 final FileProvider provider = providers.get(scheme);
939 if (provider != null) {
940
941
942
943
944
945
946 return provider.parseUri(realBase, fullPath);
947 }
948
949
950 if (scheme != null && defaultProvider != null) {
951 return defaultProvider.parseUri(realBase, fullPath);
952 }
953
954
955
956 return ((AbstractFileName) realBase).createName(resolvedPath, fileType);
957 }
958
959
960
961
962
963
964
965
966 @Override
967 public FileName resolveURI(final String uri) throws FileSystemException {
968 UriParser.checkUriEncoding(uri);
969
970 if (uri == null) {
971 throw new IllegalArgumentException();
972 }
973
974
975 final String scheme = UriParser.extractScheme(getSchemes(), uri);
976 if (scheme != null) {
977
978 final FileProvider provider = providers.get(scheme);
979 if (provider != null) {
980 return provider.parseUri(null, uri);
981 }
982
983
984 }
985
986
987 if (localFileProvider != null && localFileProvider.isAbsoluteLocalName(uri)) {
988 return localFileProvider.parseUri(null, uri);
989 }
990
991 if (scheme != null) {
992
993 FileSystemException.requireNonNull(defaultProvider, "vfs.impl/unknown-scheme.error", scheme, uri);
994 return defaultProvider.parseUri(null, uri);
995 }
996
997
998 FileSystemException.requireNonNull(baseFile, "vfs.impl/find-rel-file.error", uri);
999
1000 return resolveName(baseFile.getName(), uri, NameScope.FILE_SYSTEM);
1001 }
1002
1003
1004
1005
1006
1007
1008
1009 public void setBaseFile(final File baseFile) throws FileSystemException {
1010 this.baseFile = getLocalFileProvider().findLocalFile(baseFile);
1011 }
1012
1013
1014
1015
1016
1017
1018 public void setBaseFile(final FileObject baseFile) {
1019 this.baseFile = baseFile;
1020 }
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034 public void setCacheStrategy(final CacheStrategy fileCacheStrategy) throws FileSystemException {
1035 if (init) {
1036 throw new FileSystemException("vfs.impl/already-inited.error");
1037 }
1038
1039 this.fileCacheStrategy = fileCacheStrategy;
1040 }
1041
1042
1043
1044
1045
1046
1047
1048
1049 public void setDefaultProvider(final FileProvider provider) throws FileSystemException {
1050 setupComponent(provider);
1051 defaultProvider = provider;
1052 }
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063 public void setFileContentInfoFactory(final FileContentInfoFactory fileContentInfoFactory)
1064 throws FileSystemException {
1065 if (init) {
1066 throw new FileSystemException("vfs.impl/already-inited.error");
1067 }
1068
1069 this.fileContentInfoFactory = fileContentInfoFactory;
1070 }
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082 public void setFileObjectDecorator(final Class<?> fileObjectDecorator) throws FileSystemException {
1083 if (init) {
1084 throw new FileSystemException("vfs.impl/already-inited.error");
1085 }
1086 if (!DecoratedFileObject.class.isAssignableFrom(fileObjectDecorator)) {
1087 throw new FileSystemException("vfs.impl/invalid-decorator.error", fileObjectDecorator.getName());
1088 }
1089
1090 try {
1091 fileObjectDecoratorConst = fileObjectDecorator.getConstructor(FileObject.class);
1092 } catch (final NoSuchMethodException e) {
1093 throw new FileSystemException("vfs.impl/invalid-decorator.error", fileObjectDecorator.getName(), e);
1094 }
1095
1096 this.fileObjectDecorator = fileObjectDecorator;
1097 }
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111 public void setFilesCache(final FilesCache filesCache) throws FileSystemException {
1112 if (init) {
1113 throw new FileSystemException("vfs.impl/already-inited.error");
1114 }
1115 this.filesCache = filesCache;
1116 }
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128 @Override
1129 public void setLogger(final Log log) {
1130 this.log = log;
1131 }
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142 public void setReplicator(final FileReplicator replicator) throws FileSystemException {
1143 setupComponent(replicator);
1144 fileReplicator = replicator;
1145 }
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156 public void setTemporaryFileStore(final TemporaryFileStore tempFileStore) throws FileSystemException {
1157 setupComponent(tempFileStore);
1158 this.tempFileStore = tempFileStore;
1159 }
1160
1161
1162
1163
1164
1165
1166
1167 private void setupComponent(final Object component) throws FileSystemException {
1168 if (!components.contains(component)) {
1169 if (component instanceof VfsComponent) {
1170 final VfsComponent../org/apache/commons/vfs2/provider/VfsComponent.html#VfsComponent">VfsComponent vfsComponent = (VfsComponent) component;
1171 vfsComponent.setLogger(getLogger());
1172 vfsComponent.setContext(context);
1173 vfsComponent.init();
1174 }
1175 components.add(component);
1176 }
1177 }
1178
1179
1180
1181
1182
1183
1184
1185
1186 @Override
1187 public FileObject toFileObject(final File file) throws FileSystemException {
1188 return getLocalFileProvider().findLocalFile(file);
1189 }
1190
1191 }