Search in sources :

Example 1 with FilesCache

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);
}
Also used : Field(java.lang.reflect.Field) SoftRefFilesCache(org.apache.commons.vfs2.cache.SoftRefFilesCache) FileSystemManager(org.apache.commons.vfs2.FileSystemManager) Map(java.util.Map) SoftRefFilesCache(org.apache.commons.vfs2.cache.SoftRefFilesCache) FilesCache(org.apache.commons.vfs2.FilesCache)

Aggregations

Field (java.lang.reflect.Field)1 Map (java.util.Map)1 FileSystemManager (org.apache.commons.vfs2.FileSystemManager)1 FilesCache (org.apache.commons.vfs2.FilesCache)1 SoftRefFilesCache (org.apache.commons.vfs2.cache.SoftRefFilesCache)1