|
Friki example source code file (PropertiesFileRepository.java)
The Friki PropertiesFileRepository.java source code
package 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: |
Other websites by Alvin Alexander:
Life/living in Alaska (OneMansAlaska.com)
How I Sold My Business (HowISoldMyBusiness.com)
Copyright 1998-2011 Alvin Alexander, devdaily.com
All Rights Reserved.