Welcome, guest | Sign In | My Account | Store | Cart

Uses the java Properties class to read a java formatted property file. Returns a loaded Property object. Access the properties using the get property method.

$PropertyI getProperty SSLConfig.name

Tcl, 23 lines
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
####################################################################
# Reads a property file using the java properties object and returns 
# a property object.
####################################################################
proc hashMap { propertiesFile } {

   putsLog "proc - [info level 0 ]"

   java::import java.util.Properties
   java::import java.util.Hashtable
   java::import java.util.Map
   java::import java.io.FileInputStream

   set FileInputStreamI [ java::new FileInputStream $propertiesFile ]
   set PropertiesI      [ java::new Properties ]  

   $PropertiesI load $FileInputStreamI 

   #puts $hashTableList 

   return $PropertiesI

}
Created by Patrick Finnegan on Wed, 31 Jan 2007 (MIT)
Tcl recipes (162)
Patrick Finnegan's recipes (10)

Required Modules

  • (none specified)

Other Information and Tasks