serg472 / htmlcompressor

HTML Compressor and Minifier, can be used standalone and as a Java library
Apache License 2.0
40 stars 14 forks source link

Overwriting Readonly Files - Access Denied #51

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Make the jsp files as read only.
2. Run the ant task to compress the jsp files.
3. Gets the Access Denied Error.

 [apply] java.io.FileNotFoundException: C:\work\Projects\GCB\workspace\RevenueSummaryPortlet\WebContent\WEB-INF\jsp\associateList\assocAssociateList.jsp (Access is denied)
 [apply]     at java.io.FileOutputStream.open(Native Method)
 [apply]     at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
 [apply]     at java.io.FileOutputStream.<init>(FileOutputStream.java:70)
 [apply]     at com.googlecode.htmlcompressor.CmdLineCompressor.main(CmdLineCompressor.java:346)

What is the expected output? What do you see instead?

We should be able to overwrite the files with compressed output.

What version of the product are you using? On what operating system?
htmlcompressor-1.4.3.jar

Please provide any additional information below.

Original issue reported on code.google.com by rmul...@gmail.com on 16 Aug 2011 at 3:55

GoogleCodeExporter commented 9 years ago
It works fine when I remove read only attribute on the files.

Original comment by rmul...@gmail.com on 16 Aug 2011 at 4:01

GoogleCodeExporter commented 9 years ago
But that's what "read-only" means - that the file shouldn't be overwritten. It 
would be a bug if it was.

Also compressing JSP files is not the best approach. I would suggest using the 
compressor taglib instead that was made specially for compressing jsp.

Original comment by serg472@gmail.com on 16 Aug 2011 at 4:33

GoogleCodeExporter commented 9 years ago
We wanted to move the extra processing of compressing from the request time to 
build time. That is the reason why we are doing something like this. Do you see 
any issues with this approach please?

Original comment by rmul...@gmail.com on 16 Aug 2011 at 11:24

GoogleCodeExporter commented 9 years ago
Well, besides losing jsp readability, no

Original comment by serg472@gmail.com on 16 Aug 2011 at 11:51