Compact Class For Java – CCProperties


Compact Class is a collection of common functions and classes that can make your code more concise, fast, and precise.

utility

Class CCProperties

java.lang.Object

extended by

utility.CCProperties
Direct Known Subclasses:
CCProperties2nd

public class CCPropertiesextends java.lang.Object

CCProperties is a class to simplify reading and writing Properties.

Since:
10.03.17
Version:
12.03.17
Author:
Yosua Onesimus


Constructor Detail

CCProperties

public CCProperties()


Method Detail

load

public boolean load(java.io.InputStream inputStream)
Reads a property list (key and element pairs) from the input byte stream.
The input stream is in a simple line-oriented format as specified in
load(Reader) and is assumed to use the ISO 8859-1 character encoding;
that is each byte is one Latin1 character. Characters not in Latin1, and
certain special characters, are represented in keys and elements using
Unicode escapes.

 

Parameters:
inputStream

 

Returns:boolean


loadIntern

public boolean loadIntern(java.lang.Class clazz,
                          java.lang.String propertiesName)
Same as :
 load(clazz.getResourceAsStream(propertiesName));

 

Parameters:
clazz
propertiesName

 

Returns:boolean


loadIntern

public boolean loadIntern(java.lang.String propertiesName)
Same as :
 loadIntern(CCProperties.class, propertiesName);

 

Parameters:
propertiesName

 

Returns:boolean


loadExtern

public boolean loadExtern(java.io.FileInputStream fileInputStream)
Same as :
 load(fileInputStream);

 

Parameters:
fileInputStream

 

Returns:boolean


loadExtern

public boolean loadExtern(java.io.File file)
Same as :
 loadExtern(new FileInputStream(file));

 

Parameters:
file

 

Returns:boolean


loadExtern

public boolean loadExtern(java.lang.String parent,
                          java.lang.String child)
Same as :
 loadExtern(new File(parent, child));

 

Parameters:
parent
child

 

Returns:boolean


storeExtern

public boolean storeExtern(java.io.FileOutputStream fileOutputStream)
Writes this property list (key and element pairs) in this Properties
table to the output stream in a format suitable for loading into a
Properties table using the load(InputStream) method.

 

Parameters:
fileOutputStream

 

Returns:boolean


storeExtern

public boolean storeExtern(java.io.File file)
Same as :
 storeExtern(new FileOutputStream(file));

 

Parameters:
file

 

Returns:boolean


storeExtern

public boolean storeExtern(java.lang.String parent,
                           java.lang.String child)
Same as :
 storeExtern(new File(parent, child));

 

Parameters:
parent
child

 

Returns:boolean


setProperty

public void setProperty(java.lang.String key,
                        java.lang.String value)
Calls the Hashtable method put. Provided for parallelism with the
getProperty method. Enforces use of strings for property keys and values.
The value returned is the result of the Hashtable call to put.

 

Parameters:
key– the key to be placed into this property list.
value – the value corresponding to key.

 


getProperty

public java.lang.String getProperty(java.lang.String key)
Searches for the property with the specified key in this property list.
If the key is not found in this property list, the default property list,
and its defaults, recursively, are then checked. The method returns null
if the property is not found.

 

Parameters:
key – the property key.

 

Returns:the value in this property list with the specified key value.


getProperties

public java.util.Properties getProperties()
Returns:
Properties

setProperties

public void setProperties(java.util.Properties properties)
Parameters:
properties
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: