Saturday, January 30, 2021

URI - Filepath vs Spring Filepath Convention

 file:///C:/Path

https://en.wikipedia.org/wiki/File_URI_scheme

https://www.marcobehler.com/guides/java-files

Format[edit]

A file URI takes the form of

file://host/path

where host is the fully qualified domain name of the system on which the path is accessible, and path is a hierarchical directory path of the form directory/directory/.../name. If host is omitted, it is taken to be "localhost", the machine from which the URL is being interpreted. Note that when omitting host, the slash is not omitted (while "file:///foo.txt" is valid, "file://foo.txt" is not, although some interpreters manage to handle the latter).

RFC 3986 includes additional information about the treatment of ".." and "." segments in URIs.

How many slashes?[edit]

  • The // after the file: denotes that either a hostname or the literal term localhost will follow,[2] although this part may be omitted entirely, or may contain an empty hostname.[3]
  • The single slash between host and path denotes the start of the local-path part of the URI and must be present.[4]
  • A valid file URI must therefore begin with either file:/pathfile:///path or file://hostname/path.
  • file://path (i.e. two slashes, without a hostname) is never correct, but is often used.
  • Further slashes in path separate directory names in a hierarchical system of directories and subdirectories. In this usage, the slash is a general, system-independent way of separating the parts, and in a particular host system it might be used as such in any pathname (as in Unix systems).

Spring Filepath just has prefix "file:"
  • -DjunkCharCleanup="file:C:/Users/703250313/Desktop/ExternalConfig/junk-char-cleanup"
URI Filepath
  • -DsamlMetaDataFilepath="file:///C:/Users/703250313/Desktop/ExternalConfig/metadata.xml"

No comments:

Post a Comment

Azure - Pipeline - Add Approver for Stage

https://learn.microsoft.com/en-us/azure/devops/pipelines/process/approvals?view=azure-devops&tabs=check-pass