File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Quesiton regarding Java Property

 
Aditya Sirohi
Ranch Hand
Posts: 93
Eclipse IDE Linux VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10976
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic