File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Quesiton regarding Java Property Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Quesiton regarding Java Property" Watch "Quesiton regarding Java Property" New topic
Author

Quesiton regarding Java Property

Aditya Sirohi
Ranch Hand

Joined: Jan 05, 2010
Posts: 93

Hello,

I have a properties file with a value:-

IZ_NOTIFICATION_EXP=30

I my code i do:-
String notiExp = getProperty("IZ_NOTIFICATION_EXP") and then do
Integer.parseInt(notiExp); to use it as an integer value.


My question is what if some one passes the value of the property as IZ_NOTIFICATION_EXP="30", i.e a String. How do i validate if the user passed a String and if user passed a String i can do certain operations?

-Aditya
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10167
    
    8

Ask yourself this question. Is the data stored in the properties file text? Can it be stored as an int or any other non text type?


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Quesiton regarding Java Property
 
Similar Threads
Passed!
Passed!!!
passed
detached entity passed to persist
Passed !!!!