javax.tools.FileObject should provide support for a user-friendly name, via a getName() method. It currently provides support for a URI, which might be an obscure internal name, toString(), which is for debugging, and inferBinaryName which gives a Java-centric name for JavaFileObjects. None of these are guaranteed to be user friendly.
For JavaFileObjects created by DefaultFileManager, getName() would reasonably return the path as specified by the user. For command line source files, this would be obvious. For files found on a path, this would obviously seem to be the path name component as given by the user, followed by subdirectories and a filename as appropriate. (ie not an absolute name, or a canonical name, or any other sanitized version.)
For JavaFileObjects created by DefaultFileManager, getName() would reasonably return the path as specified by the user. For command line source files, this would be obvious. For files found on a path, this would obviously seem to be the path name component as given by the user, followed by subdirectories and a filename as appropriate. (ie not an absolute name, or a canonical name, or any other sanitized version.)
- duplicates
-
JDK-6416031 Wrong usage of URI.getPath()
- Closed
- relates to
-
JDK-6409829 JSR 199: enforce the use of valid package and class names in get{Java,}FileFor{Input,Output}
- Closed
-
JDK-6419926 JSR 199: FileObject.toUri() generates URI without schema (Solaris)
- Closed