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 7904927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:16:49+00:00 2026-06-03T10:16:49+00:00

I have this strange thing with input and output streams, whitch I just can’t

  • 0

I have this strange thing with input and output streams, whitch I just can’t understand.
I use inputstream to read properties file from resources like this:

Properties prop = new Properties();
InputStream in = getClass().getResourceAsStream( "/resources/SQL.properties" );
rop.load(in);
return prop;

It finds my file and reds it succesfully. I try to write modificated settings like this:

prop.store(new FileOutputStream( "/resources/SQL.properties" ), null);

And I getting strange error from storing:

java.io.FileNotFoundException: \resources\SQL.properties (The system cannot find the path specified)

So why path to properties are changed? How to fix this?
I am using Netbeans on Windows

  • 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-06-03T10:16:51+00:00Added an answer on June 3, 2026 at 10:16 am

    May be it works

    try
    {
    java.net.URL url = this.getClass().getResource("/resources/SQL.properties");
    
    java.io.FileInputStream pin = new java.io.FileInputStream(url.getFile());
    
    java.util.Properties props = new java.util.Properties();
    
    props.load(pin);
    }
    catch(Exception ex)
    {
    ex.printStackTrace();
    }
    

    and check the below url

    getResourceAsStream() vs FileInputStream

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

Sidebar

Related Questions

Can anyone tell me why I always have this strange output after running this
I have the following query, now the strange thing is if I run this
This is probably the most strange thing I have ever seen in Java: The
I have this strange behavior in my JSP page: I have two Integer variables
I have this strange problem. I am retrieving twitters and it works on the
I have this strange error, When I call $element_attrs = $element -> attributes(); I
i have this strange problem with the PHP function CTYPE_ALNUM if i do: PHP:
Starting from Android 3.2 I have this strange problem. It's very easy to reproduce:
So i have this rather strange issue, i am trying to line up some
I have a strange problem. I have this method, which should generate a Date

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.