[jcifs] Important New SMB URL Semantics

Michael B. Allen miallen at eskimo.com
Sun Sep 29 15:26:13 EST 2002


I  just  converted  URL  handling  in  jCIFS  to use java.net.URL entirely.
However   the   java.net.URL  semantics  are  a  little  different  in  one
significant  way.  Previously  you could compose an SmbFile from parent and
child paths like: 

  smb://server/share/path + to/file.txt

which used to give you:

  smb://server/share/path/to/file.txt

but with java.net.URL doing all URL handling this now gives you:

  smb://server/share/to/file.txt

This  is  because  there  was  no  '/'  at  the  end of the first component
indicating it's a directory. If you just always put a '/' after directories
everything works: 

  smb://server/share/path/ + to/file.txt

This should confuse a few people but technically it's correct. But we could
override  the  default parsing and relax the semantics a litte if it's real
problem. 

-- 
A  program should be written to model the concepts of the task it
performs rather than the physical world or a process because this
maximizes  the  potential  for it to be applied to tasks that are
conceptually  similar and more importantly to tasks that have not
yet been conceived. 



More information about the jcifs mailing list