Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6077521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:43:49+00:00 2026-05-23T10:43:49+00:00

these properties keep driving me crazy. I’m reading everywhere, that even loading the properties

  • 0

these properties keep driving me crazy. I’m reading everywhere, that even loading the properties should be no problem by just using:

Properties p = new Properties();
p.load(new FileInputStream("filename.properties");

Though in my case it doest work. Java is not finding the file, which is located in the class directory! Thats why i HAD TO use it with the Assetmanager:

String defaultProfileProperties = "filename.properties";
Resources resources = this.getResources();
AssetManager assetManager = resources.getAssets();
final Properties properties = new Properties();

try {
    InputStream inputStream = assetManager.open(defaultProfileProperties);
    properties.load(inputStream);
} catch (IOException e) {
    System.err.println("Failed to open " + defaultProfileProperties + " property file");
    e.printStackTrace();
}

Putting the filename.properties in the assets-folder.

Well, now I simply can’t save the properties-file by using .store(out,comment) …
I tried using a FileOutputStream with the path set to either “filename.properties”, or “assets/filename.properties”. Neither of them worked. I even added a slash here and there, but nothing is helping! I’m not finding any tutorials on the web, nor ppl having the same problem!

Could you please just help me? I guess this is such a simple thing, but i’m not getting a clue how to … blah

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:43:50+00:00Added an answer on May 23, 2026 at 10:43 am

    If you open a file with FileInputStream, then the starting directory (relative path) is based on the working directory when you started java, NOT the classpath. Opening a file with resources will reference the classpath entries.

    Have you tried using a full path when using FileInputStream()? Try that and see if it works, and if it does, then you’ll need to either set the working directory at start up and/or reference your file via relative path from the start directory.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a usercontrol that has several public properties. These properties automatically show up
I have an application that uses several configuration files (let just consider appli.properties here).
I've got some entities which have decimal properties on them. These entities' properties are
I have a dozen configuration properties files for the ant script. These files are
I have a list of custom objects. These objects have 2 datetime properties on
There are several properties on List<T> that seem to be related to number of
I need to define these two Properties to one of my linqclasses (Employee).. because
I have an edit view that is displaying some model properties as plain text
In one of my current projects we keep running into this very wierd problem
I think that we can specify or import our properties that we wish to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.