Details
-
New Feature
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Add API VFS.setManager(FileSystemManager).
Initialize VFS with the right class loader for OSGi types of scenarios to work. Must be called before any VFS APIs are called.
Instead of:
final StandardFileSystemManager fsm = new StandardFileSystemManager(); final ClassLoader classLoader = fsm.getClass().getClassLoader(); fsm.setClassLoader(classLoader); try { FieldUtils.writeDeclaredStaticField(VFS.class, "instance", fsm, true); fsm.init(); } catch (final FileSystemException | IllegalAccessException e) { ... }
do:
final StandardFileSystemManager fsm = new StandardFileSystemManager(); final ClassLoader classLoader = fsm.getClass().getClassLoader(); fsm.setClassLoader(classLoader); VFS.setManager(fsm); fsm.init();
Attachments
Issue Links
- is related to
-
VFS-424 VFS 2.0 class loading breaks in OSGi, regression from 1.0
- Closed