Code example for RemovalCause

Methods: equals

0
                                    return kb;
                                } 
                            }) 
                            .removalListener(new RemovalListener<String, File>() {
                                public void onRemoval(RemovalNotification<String, File> rn) {
                                    if (rn.getCause().equals(RemovalCause.REPLACED)) {
                                        /* don't delete replaced files */ 
                                        return; 
                                    } 
                                    removeFile(rn.getValue());
                                } 
                            }) 
                            .build(new CacheLoader<String, File>() {
                                public File load(String path) throws Exception {
                                    return downloadFile(path);
                                } 
                            }); 
 
        scanExistingFiles(); 
    }