OK, so when you have a String s = "abc|123|def|456||" and you do the following:
You end up with the array inputValues  = "abc",  = "123",  = "def",  = "456", and  will be either null, or out of range, I forget which off the top of my head, but I know it won't be in the array because the javadoc states that "Trailing empty strings are therefore not included in the resulting array."
Now for the question:
Regarding Linux directories, the separator for a File is "/", so if I code
I'm expecting "Java is using directory: /home/inputFiles/" to be displayed on the console, but what is displayed is "Java is using directory: /home/inputFiles". Does Java drop the last separator because there is nothing after it?
The name of the directory is "inputFiles" and its parent directory has the name "home". The last slash isn't part of the name of the directory itself - so it's perfectly logical that it doesn't show you the slash when you print the path of the directory.
Stuart, there is no split regarding directory names, I was using the split as an example of how Java will ignore something that doesn't exist after a separator.
Jasper, what you're saying makes sense since looking at that directory in Linux it is listed as /home/inputFiles, the issue is that I'm trying to set up Oracle permissions and when permissions are granted on (again, as an example) /home/inputFiles/* I was expecting that to grant permissions on everything within the inputFiles directory, but instead I was receiving a java.security.AccessControlException: the Permission (java.io.FilePermission /home/inputFiles read) has not been granted to userid. However, permissions granted on /home/inputFiles allows me to read and write files within the inputFiles directory.
What I'm having a hard time grasping is that FilePermission states:
A pathname that ends in "/*" (where "/" is the file separator character, File.separatorChar) indicates all the files and directories contained in that directory. A pathname that ends with "/-" indicates (recursively) all files and subdirectories contained in that directory. A pathname consisting of the special token "<<ALL FILES>>" matches any file.
So I was expecting that permissions on /home/inputFiles/* would give access to files in that directory, and that /home/inputFiles/- would give access to files in that directory and it's subdirectories. To me it almost seems as if the directory naming between File and FilePermissions conflict, read/write permissions granted on /home/inputFiles/* doesn't allow me to read or write files in /home/inputFiles/ (which is what FilePermissions says to do), yet read/write permissions on /home/inputFiles does.
I'm just trying to get a solid understanding of what is happening with the directory name so when I explain the issue to others I give them an accurate reason.
30 seconds to difuse a loaf of bread ... here, use this tiny ad: