[jcifs] Re: SmbFile.delete

Koji seaslug at hotmail.co.jp
Tue Aug 16 01:28:01 GMT 2005


Michael B Allen <mba2000 <at> ioplex.com> writes:

> 
> Post the UNC path and corresponding SMB URL you are using that represents
> the file to be deleted. I suspect your SMB URL is invalid.
> 
> Mike

Thanks for your quick response.

SMB URL is "smb://server.domain.co.jp/sharedfolder/home/koji/test/".
Seems like UNC depends on command. In queryPath, UNC seems to be 
"\server.domain.co.jp\SHAREDFOLDER\home\koji\test\test.txt". 
In delete UNC seems to be "\home\koji\test\test.txt". 

I'll post source code and a copy of log.
Source is following.

public static void main(String[] args) {
    try {
        SmbFile file = new SmbFile(
                "smb://server.domain.co.jp/sharedfolder/home/koji/test/",
                "test.txt", 
                 new NtlmPasswordAuthentication("domain.co.jp","koji","pw") );
        file.delete();
    } catch (MalformedURLException e) {
        e.printStackTrace();
    } catch (SmbException e) {
        e.printStackTrace();
    }
}

And here is a copy of log.

queryPath: \home\koji\test\test.txt
Trans2QueryPathInformation
[command=SMB_COM_TRANSACTION2,received=false,errorCode=The operation completed 
successfully.,flags=0x0018,flags2=0xD003,signSeq=0,tid=49153,pid=24871,uid=53251
,mid=3,wordCount=15,byteCount=137,totalParameterCount=136,totalDataCount=0,maxPa
rameterCount=2,maxDataCount=40,maxSetupCount=0,flags=0x00,timeout=0,parameterCou
nt=136,parameterOffset=66,parameterDisplacement=0,dataCount=0,dataOffset=202,dat
aDisplacement=0,setupCount=1,pad=1,pad1=0,informationLevel=0x101,filename=\serve
r.domain.co.jp\SHAREDFOLDER\home\koji\test\test.txt]
New data read: Transport1[server.domain.co.jp/xxx.xxx.xxx.xxx:445]
00000: FF 53 4D 42 32 00 00 00 00 98 03 C0 00 00 00 00  |?SMB2......?....|
00010: 00 00 00 00 00 00 00 00 01 C0 27 61 03 D0 03 00  |.........?'a.?..|

delete: \home\koji\test\test.txt
SmbComDelete[command=SMB_COM_DELETE,received=false,errorCode=The operation 
completed 
successfully.,flags=0x0018,flags2=0xD003,signSeq=0,tid=49153,pid=24871,uid=53251
,mid=4,wordCount=1,byteCount=55,searchAttributes=0x0006,fileName=\home\koji\test
\test.txt]
New data read: Transport1[server.domain.co.jp/xxx.xxx.xxx.xxx:445]
00000: FF 53 4D 42 06 3A 00 00 C0 98 03 C0 00 00 00 00  |?SMB.:..?..?....|
00010: 00 00 00 00 00 00 00 00 01 C0 27 61 03 D0 04 00  |.........?'a.?..|

jcifs.smb.SmbException: The system cannot find the path specified.
	at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:453)
	at jcifs.smb.SmbTransport.send(SmbTransport.java:553)
	at jcifs.smb.SmbSession.send(SmbSession.java:226)
	at jcifs.smb.SmbTree.send(SmbTree.java:95)
	at jcifs.smb.SmbFile.send(SmbFile.java:688)
	at jcifs.smb.SmbFile.delete(SmbFile.java:2099)
	at jcifs.smb.SmbFile.delete(SmbFile.java:2043)
	at JcifsTest.main(JcifsTest.java:36)

I replaced the name of server, domain and so on to general one.

Koji




More information about the jcifs mailing list