click-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Fink (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CLK-719) Click Resources Deploying prevents rapid development with container's (tomcat in my case) hot deploy
Date Mon, 27 Sep 2010 12:03:33 GMT

    [ https://issues.apache.org/jira/browse/CLK-719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12915280#action_12915280
] 

Andrew Fink commented on CLK-719:
---------------------------------

Why?
I don't have any SecutityManager, so my web app can do anything.

It is Click itself who checks for file.exists() and if file exists doesn't overwrite it.


OK, here working patch for ClickUtils.java (with this patch all works fine):

@@ -1418,10 +1418,12 @@
 
             File destinationFile = new File(destination);
 
-            if (!destinationFile.exists()) {
-                InputStream inputStream =
-                    getResourceAsStream(resource, ClickUtils.class);
+        final String curMode = getConfigService(servletContext).getApplicationMode();
+        final boolean traceOrDebug = ConfigService.MODE_TRACE.equals(curMode) || ConfigService.MODE_DEBUG.equals(curMode);
 
+        if (!destinationFile.exists() || traceOrDebug) {//file not exists or in-development
+                InputStream inputStream = getResourceAsStream(resource, ClickUtils.class);
+
                 if (inputStream != null) {
                     FileOutputStream fos = null;
                     try {


> Click Resources Deploying prevents rapid development with container's (tomcat in my case)
hot deploy
> ----------------------------------------------------------------------------------------------------
>
>                 Key: CLK-719
>                 URL: https://issues.apache.org/jira/browse/CLK-719
>             Project: Click
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 2.2.0, 2.1.0
>            Reporter: Andrew Fink
>
> Example:
> I have some template in "META-INF/resources", for ex:  META-INF/resources/admin/blabla.ftl
> I run tomcat under my IDE:
> 1) it deploys webapp - OK
> 2) click deploys  META-INF/resources/admin/blabla.ftl to webroot/admin/blabla.ftl - OK
> Then I see some mistake in blabla.ftl and bug fix it, build and deploy again.
> 1. Tomcat re-deploys webapp over existing webapp - OK!
> 2. Click doesn't deploy  blabla.ftl because It already exists (tomcat/IDE doesn't clean
folder).
> It is a problem.
> __ ClickUtils.deployFile checks only destinationFile.exists() __
> I think in debug|trace mode, Click should:
> - always overwrite (redeploy) files,
> - or checks resource length (for example: skip all bytes from resource's inputStream
to calculate it's length) and if destinationFile.length != resource.length then overwrite
(redeploy)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message