[jcifs] INVALID NAME EXCEPTION

Michael B. Allen miallen at eskimo.com
Wed Sep 4 16:41:17 EST 2002


On Tue, 3 Sep 2002 18:52:24 +0200 
Sipho Mothobi <SiphoM at discoveryhealth.co.za> wrote:

> Howzit i found out what the problem is.....
> 
> it is simply the file name that i am giving to the file.
> :HD_INCIDENT_90435_C:\setup.bat
> 
> this is caused by the fact that the File.separator on solaris is "/" while
> on windows it is "\". Thus as i am uploading the file from a windows machine
> it has a "\"!= File.separator.
> 
> do you by anychance have a possible solution to this.

This is just string manipulation Sipho. You're going to have to prune
that odd volume label off with indexOf( '\\' ) and substring() etc.

> 
> thank you
> sipho
> 
> SAVING FILE.....
>  ** client filename: C:\setup.bat
>  ** client file is 64 bytes long.
>  ** client ContentType : application/octet-stream
>  FILENAME = HD_INCIDENT_90435_C:\setup.bat
> DEFAULT SAVING FILE PATH =  DHPOD01/ATTACHMENTS/INTRAVENUS/TEST/
> -> DEFAULT SAVING FILE PATH =  DHPOD01/ATTACHMENTS/INTRAVENUS/TEST/
>  CREATING NEW DIRECTORY
> smb://portal:prtlive@DHPOD01/ATTACHMENTS/INTRAVENUS/TEST/200209
> DEFAULT SAVING FILE PATH =  DHPOD01/ATTACHMENTS/INTRAVENUS/TEST/
> TRUE SAVING FILE PATH =  DHPOD01/ATTACHMENTS/INTRAVENUS/TEST/200209/
> SAMBA FILENAME =
> smb://portal:prtlive@DHPOD01/ATTACHMENTS/INTRAVENUS/TEST/200209/HD_INCIDENT_
> 90435_C:\setup.bat
> 
> 
> 
> -----Original Message-----
> From: Michael B. Allen [mailto:miallen at eskimo.com]
> Sent: 03 September 2002 00:24
> To: Sipho Mothobi
> Cc: jcifs at lists.samba.org
> Subject: Re: [jcifs] INVALID NAME EXCEPTION
> 
> 
> On Mon, 2 Sep 2002 18:52:22 +0200
> Sipho Mothobi <SiphoM at discoveryhealth.co.za> wrote:
> 
> > I have been working on a system to save uploaded files on to a NT machine
> > from a Solaris box, i had lots of options on how i could implement this.
> > Most of them looked very complecated and required a two step solution.
> >  
> > I was happy to realise that the jCIFS was arround implemented a test case
> on
> > a 2000 machine worked fine then moved it to Solaris and got this horrible
> > exception PLEASE HELP :
> >  
> >  jcifs.smb.SmbException: Invalid name
> >         at jcifs.smb.SmbTransport.send(SmbTransport.java:495)
> >         at jcifs.smb.SmbSession.send(SmbSession.java:135)
> >         at jcifs.smb.SmbTree.send(SmbTree.java:91)
> >         at jcifs.smb.SmbFile.send(SmbFile.java:499)
> >         at jcifs.smb.SmbFile.open(SmbFile.java:555)
> >         at
> > jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:107)
> >         at
> jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:92)
> >         at
> jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:62)
> >         at
> >
> za.co.ediscovery.portal.utils.filesystem.SambaFacade.saveFile(SambaFacade.ja
> > va:151)
> 
> I  can't determine the problem without more information. Please isolate the
> operation  (e.g.  write()  ...?)  that's  causing  this exception, create a
> simple  demo  program,  and  send  me  a -Dlog=ALL trace of it. For optimal
> service an additional Ethereal or Netmon trace would be helpful. 
> 
> -- 
> 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. 
> 


-- 
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