aspose file tools
The moose likes Java in General and the fly likes Help with Properties file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Help with Properties file" Watch "Help with Properties file" New topic
Author

Help with Properties file

Med Shabe
Ranch Hand

Joined: May 08, 2001
Posts: 84
Apparently Properties file is not meant to be read dynamically. In other words, I cannot go through a directory and create Properties files basd on available files that have attribute=value format.
Pleass, could someone show me the way on how to go about doing the above. I need to read values from files and upload them onto table.

Thanks.
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4118
    
    2

try the load() method:

hth,
Junilu
[This message has been edited by JUNILU LACAR (edited October 16, 2001).]


Junilu - [How to Ask Questions] [How to Answer Questions] [MiH]
Med Shabe
Ranch Hand

Joined: May 08, 2001
Posts: 84
I am using the load method but the execution doesn't make it that far. The funnier (or more upsetting) thing is that it sees the file but then it throws FileNotFoundException and sometimes NullPointerException on my face.
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4118
    
    2

Med,
Post some code and we'll see if we can get to the bottom of this.
Junilu
Med Shabe
Ranch Hand

Joined: May 08, 2001
Posts: 84
I've tried making this as short as possible: Let me know if you need more.
Appreciate you guys looking into this.
dataFile is of type String, that's what getFileWithExtension returns.
ICONFEED is of Properties type.
Program does not makes it beyond the while.
.
.
.
while ((dataFile = getFileWithExtension(dirPath, fileExt))!= null )
{
if (dataFile == null)
System.out.println(dataFile + "not found!");
System.out.println("File: " + dataFile);
FileInputStream fisdat = new FileInputStream(dataFile);
boolean Renresult = copyFile(dirPath,logDir);
System.out.println("Moving" + dataFile);

ICONFEED.load(fisdat);
System.out.println("Loaded " + fisdat);
System.out.println("Processing: " + dataFile);
("Reading dataFile " + dataFile);
System.out.println("Reading properties");
Feed = ICONFEED.getProperty("FEED");
}
System.out.println("No more files to process!");
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Help with Properties file
 
Similar Threads
Reading Properties files into table
Applet Security
How to read a description of a file
.ini file in Web App Environment
Reading files