Adding constant for line.separator and friends
Alan Bateman
Alan.Bateman at Sun.COM
Thu Nov 12 10:35:55 UTC 2009
Ulf Zibis wrote:
> :
> At least, IMO, fileSeparator() and pathSeparator() would belong to
> java.io.File or java.nio.file.FileSystem.
As I think Martin pointed out, File.separator and File.pathSeparator
have always been there. They should of course have been methods rather
than fields. In theory the separators could be more than a single
character but it's hard to find examples. One could debate as to if File
was the right place to define the path separator as the concept of path
is more of a shell or system concept. It's also worth pointing out that
FileSystem already defines a getSeparator method. In the case of the
default FileSystem then it will return the same as File.separator. When
additional providers are installed then they may use different
separators of course.
-Alan.
More information about the core-libs-dev
mailing list