Solved

.properties file creation

Posted on 2011-03-15
6
1,630 Views
Last Modified: 2012-06-21
Please advice how to create .properties file in JDeveloper.
In NetBeans it's option in New, but in jdev I can't find where is it.
0
Comment
Question by:gbcbr
6 Comments
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 50 total points
ID: 35140910
A properties file is just a text file, so if there's no special option, it probably won't matter
0
 

Author Comment

by:gbcbr
ID: 35140960
I know this, I just want to create it by IDE, so it will place properly and make visible. Otherwise I have to know in which directory to put it.
I have bad experience with image files, I put them as I understood properly, inside of src directory, but they invisible for IDE.
Maybe it track them in some way.
0
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 35141019
as per i know in jdevelpoer only xml file have not property file
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:gbcbr
ID: 35141031
This what I'm found only.
So, in which directory to place externally created file?
0
 
LVL 92

Accepted Solution

by:
objects earned 100 total points
ID: 35142715
depends on how you are loading it. If you are loading it using the classloader then you need to put it in a directory that is in the classpath
If you're loading it directly as a file then you can put it anywhere

I'd suggest creating a directory named say 'resource' and put it in there.
If you want to load then with the classloader then also add that folder to your classpath


0
 
LVL 2

Assisted Solution

by:calboronster
calboronster earned 100 total points
ID: 35146393
One of the better and fail-safe ways to manage and control the external file location is
to mention a JVM runtime system parameter (for example user.home). And use this property in your application code (through System.getProperty) to retrieve the absolute path of the file. I use this to retrieve the .properties files in my application.

1. In JVM properties define as :
Java .. -Duser.home=/etc/properties/abc.properties ...

2. In file read location as
String userhome = System.getProperty("user.home");

The basic advantage of this method is that this makes your application and its properties as container independent and easily manageable.
Secondly, the testing of properties requires you to simply alter the value of the property.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now