*
* @see org.wicketstuff.security.hive.config.HiveFactory#createHive()
*/
public final Hive createHive()
{
BasicHive hive = constructHive();
boolean readAnything = false;
for (URL file : policyFiles)
{
readAnything = true;
try
{
readPolicyFile(file, hive);
}
catch (IOException e)
{
log.error("Could not read from " + file, e);
}
}
for (InputStream stream : inputStreams)
{
readAnything = true;
try
{
readInputStream(stream, hive);
}
catch (IOException e)
{
log.error("Could not read from stream", e);
}
}
inputStreams.clear();
for (Reader stream : inputReaders)
{
readAnything = true;
try
{
readInputReader(stream, hive);
}
catch (IOException e)
{
log.error("Could not read from reader", e);
}
}
inputReaders.clear();
if (!readAnything)
log.warn("No policyFiles or inputstreams were added to the factory!");
hive.lock();
return hive;
}