MappedDirectoryLocalFSMountStrategy implements LocalFSMountStrategy { public void saveInPropertiesFile(java.io.File propertiesFile) throws IOException { final Properties properties = new Properties(); for (Map.Entry<String, java.io.File> e : mapping.entrySet()) { properties.setProperty(e.getKey(), e.getValue().getAbsolutePath()); } try (Writer out = new FileWriter(propertiesFile)) { properties.store(out, null); } } MappedDirectoryLocalFSMountStrategy(Map<String, java.io.File> mapping);  MappedDirectoryLocalFSMountStrategy(); @Inject private  MappedDirectoryLocalFSMountStrategy(@Named("vfs.local.directory_mapping_file") java.io.File mappingFile); @PostConstruct void start(); @PreDestroy void stop(); void loadFromPropertiesFile(java.io.File propertiesFile); void saveInPropertiesFile(java.io.File propertiesFile); @Override java.io.File getMountPath(String workspaceId); @Override java.io.File getMountPath(); void setMountPath(String workspaceId, java.io.File mountPath); void removeMountPath(String workspaceId); Map<String, java.io.File> getDirectoryMapping();  }
@Test public void savesMappingInPropertiesFile() throws Exception { final Map<String, java.io.File> mapping = new HashMap<>(); mapping.put(workspaceId, mountPath); final MappedDirectoryLocalFSMountStrategy mountStrategy = new MappedDirectoryLocalFSMountStrategy(mapping); mountStrategy.saveInPropertiesFile(mappingFile); final Properties mappingProperties = new Properties(); try (Reader in = new FileReader(mappingFile)) { mappingProperties.load(in); } assertEquals(mountPath, new java.io.File(mappingProperties.getProperty(workspaceId))); }