• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help with Properties file

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try the load() method:

hth,
Junilu
[This message has been edited by JUNILU LACAR (edited October 16, 2001).]
 
Med Shabe
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Med,
Post some code and we'll see if we can get to the bottom of this.
Junilu
 
Med Shabe
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!");
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic