Re: SmbFile delete take too much time
Michael B Allen <[email protected]>
| Newsgroups | gmane.network.samba.java |
|---|---|
| Message-ID | <CAGMFw4hEuSPFsbD5OE0WtpAgr+pZUJwr1xa2+4Sh2Yi-Q8S6jA@mail.gmail.com> |
On Fri, Jul 13, 2012 at 3:48 AM, yatin.baraiya <[email protected]> wrote: > Hi all, > > My web-based j2ee application is based on following technology: > Frame Work:Struts2.0 > Server:Tomcat 6.0 > Front UI:JSP,JSTL/Struts tag,HTML > For saving/getting any files from the windows web server we have use the > jcifs-1.3.14.jar file. > Database:Microsoft SQL Server 9.00.2047.00 > Language:Core java,XML,xslt. > > Right now i have upload one folder to the server having 1000 > documents,with Using the SmbFile api. > Now i delete this folder from the java ,For that as per the logic , first i > deletes all documents inside the folder and then delete this folder. > below is my java code for deleting the documents > SmbFile removeFile = null; > String remotePath = "c://windows//server"; > try > { > removeFile = new SmbFile(remotePath + relativeLocation); > removeFile.delete(); > } > catch (SmbException b) > { > continue; > } > while the above process taking too much time to delete the documents, (it > will take time because , it will delete file from the windows web server Hi Yatin, How much time is too much time. Is it 10 seconds or 10 minutes or ...? JCIFS is very fast. Deleting a folder with 100,000 entries should take less than 2 seconds. So I would suggest looking in the examples directory for an example that deletes a file or modify one of the examples to simulate what you're doing. The you can test your operation on the commandline. If you find that it is also slow, enable logging and study where the delay is. My first guess would be that it's a name service problem. Meaning JCIFS is trying the name, it times out and then it falls back to another server or method and then it succeeds. Mike -- Michael B Allen Java Active Directory Integration http://www.ioplex.com/ > [other computer]) is there any other option which improve my delete process > fast.any help regarding this will be appreciate for me.said issue is > critical for me. > > Thanks in Advance > Yatin Baraiya