You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Prateek Temkar <pr...@gmail.com> on 2009/02/19 09:47:11 UTC

Tuscany 1.3.2 October 2008 Release. Changes to org.apache.tuscany.sca.contribution.service.impl.ContributionRepositoryImpl

Hi,
    I'm using Tuscany 1.3.2 October 2008 Release.
When a webapp is deployed, it creates an empty directory named 'target'.
I have seen another post regarding this issue and Luciano Resende  replied
that he'd start a discussion in the dev list about the clean up.
In my Tuscany source, I've commented the following part in constructor of
org.apache.tuscany.sca.contribution.service.impl.ContributionRepositoryImpl.
This prevents the directory from being created.

----------------------------------------------------------------------------------------------------------------------------------------
 try {
            AccessController.doPrivileged(new
PrivilegedExceptionAction<Object>() {
                public Object run() throws IOException {
                    FileHelper.forceMkdir(rootFile);
                    return null;
                }
            });
        } catch (PrivilegedActionException e) {
            error("PrivilegedActionException", rootFile,
(IOException)e.getException());
            throw (IOException)e.getException();
        }

         Allow privileged access to test file. Requires FilePermissions in
security policy file.
        Boolean notDirectory = AccessController.doPrivileged(new
PrivilegedAction<Boolean>() {
            public Boolean run() {
                return (!rootFile.exists() || !rootFile.isDirectory() ||
!rootFile.canRead());
            }
        });
        if (notDirectory) {
            error("RootNotDirectory", rootFile, repository);
            throw new IOException("The root is not a directory: " +
repository);
        }
---------------------------------------------------------------------------------------------------------------------------------------

Would it cause any problems else where?

thnx
-Prateek Temkar

Re: Tuscany 1.3.2 October 2008 Release. Changes to org.apache.tuscany.sca.contribution.service.impl.ContributionRepositoryImpl

Posted by Luciano Resende <lu...@gmail.com>.
This has been fixed in the 1.4 release, you can probably check the
latest ContributionRepositoryImpl in the 1.4 or 1.x branch to apply
the same fix to your code base. As far as i remember, just commenting
out this part would cause issues with some test cases.

On Thu, Feb 19, 2009 at 12:47 AM, Prateek Temkar <pr...@gmail.com> wrote:
> Hi,
>     I'm using Tuscany 1.3.2 October 2008 Release.
> When a webapp is deployed, it creates an empty directory named 'target'.
> I have seen another post regarding this issue and Luciano Resende  replied
> that he'd start a discussion in the dev list about the clean up.
> In my Tuscany source, I've commented the following part in constructor of
> org.apache.tuscany.sca.contribution.service.impl.ContributionRepositoryImpl.
> This prevents the directory from being created.
>
> ----------------------------------------------------------------------------------------------------------------------------------------
>  try {
>             AccessController.doPrivileged(new
> PrivilegedExceptionAction<Object>() {
>                 public Object run() throws IOException {
>                     FileHelper.forceMkdir(rootFile);
>                     return null;
>                 }
>             });
>         } catch (PrivilegedActionException e) {
>             error("PrivilegedActionException", rootFile,
> (IOException)e.getException());
>             throw (IOException)e.getException();
>         }
>
>          Allow privileged access to test file. Requires FilePermissions in
> security policy file.
>         Boolean notDirectory = AccessController.doPrivileged(new
> PrivilegedAction<Boolean>() {
>             public Boolean run() {
>                 return (!rootFile.exists() || !rootFile.isDirectory() ||
> !rootFile.canRead());
>             }
>         });
>         if (notDirectory) {
>             error("RootNotDirectory", rootFile, repository);
>             throw new IOException("The root is not a directory: " +
> repository);
>         }
> ---------------------------------------------------------------------------------------------------------------------------------------
>
> Would it cause any problems else where?
>
> thnx
> -Prateek Temkar
>



-- 
Luciano Resende
Apache Tuscany, Apache PhotArk
http://people.apache.org/~lresende
http://lresende.blogspot.com/