use of org.apache.commons.vfs2.FilesCache in project wso2-synapse by wso2.
the class VFSTransportSenderTest method getSoftReferenceMap.
private Map<?, ?> getSoftReferenceMap(VFSTransportSender vfsTransportSender) throws NoSuchFieldException, IllegalAccessException {
Field field = VFSTransportSender.class.getDeclaredField("fsManager");
field.setAccessible(true);
FileSystemManager fsm = (FileSystemManager) field.get(vfsTransportSender);
FilesCache fileCache = fsm.getFilesCache();
SoftRefFilesCache softRefFilesCache = (SoftRefFilesCache) fileCache;
Field field1 = SoftRefFilesCache.class.getDeclaredField("refReverseMap");
field1.setAccessible(true);
return (Map<?, ?>) (Map) field1.get(softRefFilesCache);
}
Aggregations