There seems to be a large number of non-consistent conventions referring to parts of a filename based on platform, programming language, etc. PHP uses one terminology, POSIX something else, etc. Is there an accepted standard in Java?
For example, given filename: c:\dev\project\file.txt
, Apache Commons FilenameUtils defines the following:
c:\dev\project\file.txt
- the prefix - C:\
- the path - dev\project\
- the full path - C:\dev\project\
- the name - file.txt
- the base name - file
- the extension - txt
However, this class leaves out the nomenclature used to refer to the complete string (ie: c:\dev\project\file.txt). It already uses "path" to refer to the folder structure, so that cannot be reused.
What is the proper term I can use to refer to the entire c:\dev\project\file.txt
? A reference to an authoritative source defining the term would be appreciated as well.
Furthermore, how would you treat an instance where you have a file called: c:\dev\project\file.txt.ext2.ext3
? Would basename now be file.txt.ext2
? Is extension, by definition, the part of the filename which trails the last '.'? I suspect that the complete filename should be basename + extension?