aspose file tools*
The moose likes Java in General and the fly likes max line length for a .properties file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "max line length for a .properties file" Watch "max line length for a .properties file" New topic
Author

max line length for a .properties file

Stephen Ferg
Greenhorn

Joined: Apr 23, 2007
Posts: 9
I use Spring and properties file. But I don't think this is a specific spring question so I choose to post it here --- what's the max line length allowed in a .properties file. I have a xyz.properties file. Some lines have about 220 characters. it works fine. Do you know if there is a max line length for such file ?

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18991
    
    8

There isn't one. Otherwise the part of the documentation which explains the contents of the file in excruciating detail would mention it.

Actually I didn't check the documentation before I typed that, but I'm sure it's true. It isn't in the nature of Java to have arbitrary restrictions like that. Each line is read into a String and there's no arbitrary limit on the length of a String, so there you go. In other languages you might be reading data into some kind of fixed-length string thing, but Java doesn't really have fixed-length string things.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19790
    
  20

There is obviously the Integer.MAX_VALUE limit, but after checking the source code I didn't see any other limit.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: max line length for a .properties file