I am getting an exception "2 : No such File" while calling mkdir function of ChannelSftp class of Jsch Library.
At the time of calling a function i am passing value "testing/FirstFolder" but it doesn't create a folder inside a folder and gives me an exception.
If I create a single folder then it will be created successfully like For Eg: if i give mkdir("testing"); then it will create "testing" folder on ftp successfully but just after this if I call mkdir("testing"+File.separator+"FirstFolder"); then it gives me an exception of No such file.
To create the folder "testing/FirstFolder" the folder "testing" must exist. You need to use
BUT - you will get an exception if either of the folders already exists. You can either ignore it if you are sure the file is actually a directory or you can use use the stat() method to look at the attributes.
P.S. I don't actually get a "No such File" exception but I don't have access to your code to see what I am doing differently.
Om Prakash Bijawat
Joined: Feb 01, 2013
Thanks Richard ya its working fine ...actually the prob is of File separator..