org.mmbase.util.ExtendedProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mmbase-utils Show documentation
Show all versions of mmbase-utils Show documentation
<p>
MMBase Utils is a part of MMBase, but can also be used in
other projects. It contains several kind of utility
classes.</p>
<p>Highlights:</p>
<ul>
<li>An implementation of 'events'. Threads can use this to
communicate certain things. Using mmbase-clustering,
these events can also be sent to other servers.</li>
<li>A logging framework</li>
<li>A framework for string and byte array transformeration,
plus a whole lot of implemetentations for that.</li>
<li>Several java.util like classes (collections, dateparsing)</li>
<li>File type recognition ('magicfile')</li>
<li>The MMBase resourceloader, a generic fall-back mechanism
for configuration files and similar resources.</li>
<li>...</li>
</ul>
The newest version!
/*
This software is OSI Certified Open Source Software.
OSI Certified is a certification mark of the Open Source Initiative.
The license (Mozilla version 1.0) can be read at the MMBase site.
See http://www.MMBase.org/license
*/
package org.mmbase.util;
import java.io.*;
import java.util.*;
import org.mmbase.util.logging.Logger;
import org.mmbase.util.logging.Logging;
/**
* This is a flexible Properties version, it can handle saving of Properties with
* the comments that will stay in your file.
* @author Jan van Oosterom
* @version $Id$
* @deprecated
*/
public class ExtendedProperties extends Properties {
private static final Logger log = Logging.getLoggerInstance(ExtendedProperties.class);
/**
* The prefix of the comment in the Properties file.
* Everything after it will be treaded as comment
*/
protected String commentPrefix = "#";
/**
* Extended Properties constructor
*/
public ExtendedProperties() {
}
/**
* Create and read an ExtendedProperty from file.
* @param filename The file from were to read.
*/
public ExtendedProperties(String filename) {
try {
getProps(filename);
} catch (IOException e) {
log.error("Failed to load the ExtendedProperties for: "+ filename);
}
}
/**
* Create an ExtendedProperties with a Allready filled ExtendedProperty list.
* @param exProp The list that will be put in this ExtendedProperty.
*/
public ExtendedProperties(ExtendedProperties exProp) {
// super((Properties) exProp);
super(exProp);
}
/**
* Read from Properties and return them.
* @param filename The file from were to read the Properties.
*/
public Hashtable