tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 57308] New: Replace System.getProperty("file.separator") with File.separator throughout
Date Thu, 04 Dec 2014 13:04:24 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=57308

            Bug ID: 57308
           Summary: Replace System.getProperty("file.separator") with
                    File.separator throughout
           Product: Tomcat 7
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: trivial
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: sebb@apache.org

Most of Tomcat uses File.separator, but there are a few instances of
System.getProperty("file.separator")

The two can be different, but still allow the JVM to start up.
I found the following worked:

java -Dfile.separator=/xyz

for Unix or the equivalent \xyz on Windows.

Using a different first character does not work - the JVM usually throws an
exception as it cannot find some required files if the sep. is incorrect.

It looks like only the first character of the property is used by the JVM.
However, this is not done by the application code I have seen, which means that
there could be a discrepancy between the two methods.

File.separator has the additional benefit that it is not subject to a privilege
check.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message