ASPN ActiveState Programmer Network  
ActiveState, a division of Sophos
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups
Submit Recipe
My Recipes

All Recipes
All Cookbooks


View by Category

Title: Create Properties Object. Return loaded property object.
Submitter: Patrick Finnegan (other recipes)
Last Updated: 2007/01/31
Version no: 1.0
Category: TclBlend

 

Not Rated yet


Description:

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

Source: Text Source

####################################################################
# 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

}

The license for this recipe is available here.

Discussion:



Add comment

No comments.



Highest rated recipes:

1. With busy cursor

2. Get widget info

3. Simplified mega-widiget ...

4. Supporting mouse wheel ...

5. Multi-character split

6. LCD Number Display

7. Check creditcard numbers ...

8. A minimal debugger

9. Socket based communicatio...

10. WSCP - showServerStatus




Privacy Policy | Email Opt-out | Feedback | Syndication
© 2006 ActiveState Software Inc. All rights reserved.