You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2008/01/29 12:39:34 UTC

[jira] Assigned: (SLING-202) osgi install action deletes temp file before it gets installed

     [ https://issues.apache.org/jira/browse/SLING-202?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger reassigned SLING-202:
---------------------------------------

    Assignee: Felix Meschberger

> osgi install action deletes temp file before it gets installed
> --------------------------------------------------------------
>
>                 Key: SLING-202
>                 URL: https://issues.apache.org/jira/browse/SLING-202
>             Project: Sling
>          Issue Type: Bug
>          Components: Console
>            Reporter: Tobias Bocanegra
>            Assignee: Felix Meschberger
>
> sometimes it happens that when uploading a new bundle it just doesn't get installed.
> this problem occurs more often when i'm using for example curl to upload it.
> i think the problem is that the request-thread deletes the file before the install thread gets hold of it.
> when i remove the tmpFile.delete finally block, it works just fine.
> Index: console-web/src/main/java/org/apache/sling/osgi/console/web/internal/core/InstallAction.java
> ===================================================================
> --- console-web/src/main/java/org/apache/sling/osgi/console/web/internal/core/InstallAction.java        (revision 615347)
> +++ console-web/src/main/java/org/apache/sling/osgi/console/web/internal/core/InstallAction.java        (working copy)
> @@ -99,10 +99,9 @@
>          }
>  
>          // install the bundle now
> -        File tmpFile = null;
>          try {
>              // copy the data to a file for better processing
> -            tmpFile = File.createTempFile("install", ".tmp");
> +            File tmpFile = File.createTempFile("install", ".tmp");
>              bundleItem.write(tmpFile);
>              bundleLocation = "inputstream:" + bundleItem.getName();
>  
> @@ -110,10 +109,6 @@
>          } catch (Exception e) {
>              getLog().log(LogService.LOG_ERROR,
>                  "Problem accessing uploaded bundle file", e);
> -        } finally {
> -            if (tmpFile != null) {
> -                tmpFile.delete();
> -            }
>          }
>  
>          return true;

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