Results 1 to 3 of 3
  1. #1
    samaravadhi is offline Member
    Join Date
    Sep 2011
    Rep Power

    Default getResourceAsStream

    can you help me which method should i used to load all the files from a directory instead of one file. i need all files to be loaded

    InputStream is1 = Compare.class.getResourceAsStream(F1);
    Properties prop = new Properties();

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Rep Power

    Default Re: getResourceAsStream

    You would probably need to create a File object representing the directory and then use whatever the method is that lists the files in it...possibly called listFiles().

    Unless this is in a jar file?

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Eastern Florida
    Rep Power

    Default Re: getResourceAsStream

    load all the files from a directory instead of one file.
    Are you asking how to use the Properties class's load method to read all of the files in a directory (all properties files I assume) and merge them into one instance of the Properties class?
    One way to do it would be to extend the InputStream class and have that class read the contents of all the files and return them to the load() method.

Similar Threads

  1. Replies: 26
    Last Post: 05-31-2010, 10:05 PM
  2. Replies: 2
    Last Post: 05-31-2009, 06:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts