loading a configuration file

Posted on 2011-05-10
Medium Priority
Last Modified: 2012-05-11

I have a configuration file that i need to load in (data.txt). The package my class that wishes to load the file is in com.test.loader.

In my class I am using LoaderUtility.class.getResourceAsStream(data.txt)

The data.txt is not within the same jar file. I need to place this into a self contained jar, this jar will only contain the data.txt file. What package structure is required for this new jar file so it can be loaded in by the LoaderUtility.jar.

Question by:singh101
  • 2
LVL 10

Assisted Solution

GlobaLevel earned 1600 total points
ID: 35730229

Author Comment

ID: 35730442
Not really. I need to place this data.txt in its own jar file. Would this then need to be in the same package com.test.loader?
LVL 10

Accepted Solution

GlobaLevel earned 1600 total points
ID: 35731216
Would this then need to be in the same package com.test.loader
>> yes i would try that...

Assisted Solution

webdev2000 earned 400 total points
ID: 35733501
Yes it would need to be in the same package/directory structure to use that line
Or you could specify the absolute path to put it elsewhere

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
A solution for Fortify Path Manipulation.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses
Course of the Month16 days, 15 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question