|
Friki example source code file (PropertiesFileRepository.java)
The Friki PropertiesFileRepository.java source codepackage tests; import java.util.Properties; import java.io.InputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import com.efsol.friki.*; public class PropertiesFileRepository extends InMemoryRepository { public PropertiesFileRepository(File input) { super(new Properties()); Properties props = (Properties)map; try { InputStream in = new FileInputStream(input); props.load(in); in.close(); } catch(IOException ioe) { ioe.printStackTrace(); } } public Page load(String name) { Page page = new Page(name); String content = (String)map.get(name); page.setContent(content); return page; } } Other Friki examples (source code examples)Here is a short list of links related to this Friki PropertiesFileRepository.java source code file: |
... this post is sponsored by my books ... | |
![]() #1 New Release! |
![]() FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.