Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any length limit for value kept in properties file?

I have configAllowedUsers.properties.

It has single in Entry like the following:

users = abc, pew, rt, me1, me3, ku3,........

I have some doubts about length of value stored in it. I will read it using java.util.Properties. Thousands of usernames would be stored in it and I could not store them in database.

like image 891
Oomph Fortuity Avatar asked Feb 09 '23 07:02

Oomph Fortuity


1 Answers

I had the same question in mind today, so I started researching. I did not find any limitations originating from java.util.Properties, so it is probably safe to assume that the rules are the same as for String:

  • A String of length Integer.MAX_VALUE (which is 231-1)
  • Or half your maximum heap size,

Whichever is reached first in your environment.


Of course, not finding any official statements on this topic does not prove that these assumptions are correct, but let's consider the Properties class innocent unless proven guilty.

like image 139
Hexaholic Avatar answered Feb 10 '23 21:02

Hexaholic