This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Servlets and the fly likes HTML File is getting locked by bat file call or Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HTML File is getting locked by bat file call or Tomcat" Watch "HTML File is getting locked by bat file call or Tomcat" New topic
Author

HTML File is getting locked by bat file call or Tomcat

Akshay D Joshi
Greenhorn

Joined: Aug 04, 2011
Posts: 9
I am calling a bat file in java
In bat file i am appending multiple html files to one Final html file

---Bat file code --

@echo off
IF EXIST consolidatedHTML.html (
del consolidatedHTML.html --- > if user creats html for the second time then i delete existing file and create new
)
call type %2\file 1.html >> %1\consolidatedHTML.html
call type %2\file 2.html >> %1\consolidatedHTML.html
call type %2\file 3.html >> %1\consolidatedHTML.html

--end Bat file code

After this Final html is generated i convert this file to pdf using htmltopdf converter in java..

when i convert this file to pdf the request is sent to server ,but it is not executed.
So i came to know that the Final html is locked .
When i try to delete file manually ,
windows alert comes : file is being used by another person or program.

when i shotdown tomcat and delete the file manually,it gets deleted.

So which process is holding my file Tomcat process or Batch file process ?....

Also the main thing is that multiple users access the batch file and htmltopdf code .


What is the solution for this ?

One is to write java code for appending html files..so i can,but need to know the reason for the above issue.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTML File is getting locked by bat file call or Tomcat