agave-apps/apps-core/src/main/java/org/iplantc/service/apps/queue/actions/CloneAction.java
/**
     * Calculates the {@link Software#getDeploymentPath()} to which the cloned app assets will be copied.
     * 
     * @param clonedSoftware the cloned {@link Software} object
     * @param publishedSoftwareDataClient the {@link RemoteDataClient} for the {@link Software#getStorageSystem()}
     * @return  {@link Software#getDeploymentPath()} for the cloned app
     * 
     * @throws IOException
     * @throws RemoteDataException
     * @throws PermissionException 
     */
Calculates the  Software#getDeploymentPath() to which the cloned app assets will be copied.

@param clonedSoftware the cloned  Software object
@param publishedSoftwareDataClient the  RemoteDataClient for the  Software#getStorageSystem()
@return   Software#getDeploymentPath() for the cloned app


Calculates the Software#getDeploymentPath () to which the cloned app assets will be copied . @param clonedSoftware the cloned Software object @param publishedSoftwareDataClient the RemoteDataClient for the Software#getStorageSystem () @return Software#getDeploymentPath () for the cloned app
protected String resolveAndCreatePublishedDeploymentPath(Software clonedSoftware, RemoteDataClient publishedSoftwareDataClient) 
    throws IOException, RemoteDataException, PermissionException 
    {
        String remoteDeploymentPath = this.clonedSoftwareDeploymentPath;
        if (StringUtils.isEmpty(remoteDeploymentPath)) {
            remoteDeploymentPath = String.format("%s/applications/%s", 
                                                clonedSoftware.getOwner(), 
                                                clonedSoftware.getUniqueName());
        }
        LogicalFile logicalFile = null;
        try {
            logicalFile=LogicalFileDao.findBySystemAndPath(clonedSoftware.getStorageSystem(), 
                                                            publishedSoftwareDataClient.resolvePath(remoteDeploymentPath));
        } catch(Exception ignored) {}
        PermissionManager pm = new PermissionManager(clonedSoftware.getStorageSystem(), 
                publishedSoftwareDataClient,
                logicalFile, 
                clonedSoftware.getOwner());
        if (!publishedSoftwareDataClient.doesExist(remoteDeploymentPath)) {
            if (pm.canReadWrite(publishedSoftwareDataClient.resolvePath(remoteDeploymentPath))) {
                publishedSoftwareDataClient.mkdirs(remoteDeploymentPath, clonedSoftware.getOwner());
            } else {
                throw new PermissionException(
                        "User does not have permission to access the deployment path " + 
                        remoteDeploymentPath + " on the target " + 
                        "deployment system. Verify you have been granted at lease  " + PermissionType.READ_WRITE +
                        " permission on the target execution system " + clonedSoftware.getStorageSystem().getSystemId());
            }
        } else if (!pm.canReadWrite(publishedSoftwareDataClient.resolvePath(remoteDeploymentPath))) {
            throw new PermissionException(
                    "User does not have permission to access the deployment path " + 
                    remoteDeploymentPath + " on the target " + 
                    "deployment system. Verify you have been granted at lease  " + PermissionType.READ_WRITE +
                    " permission on the target execution system " + clonedSoftware.getStorageSystem().getSystemId());
        }
        return remoteDeploymentPath;
    }
protected String resolveAndCreatePublishedDeploymentPath ( Software clonedSoftware , RemoteDataClient publishedSoftwareDataClient ) throws IOException , RemoteDataException , PermissionException { String remoteDeploymentPath = this . clonedSoftwareDeploymentPath ; if ( StringUtils . isEmpty ( remoteDeploymentPath ) ) { remoteDeploymentPath = String . format ( "%s/applications/%s" , clonedSoftware . getOwner ( ) , clonedSoftware . getUniqueName ( ) ) ; } LogicalFile logicalFile = null ; try { logicalFile = LogicalFileDao . findBySystemAndPath ( clonedSoftware . getStorageSystem ( ) , publishedSoftwareDataClient . resolvePath ( remoteDeploymentPath ) ) ; } catch ( Exception ignored ) { } PermissionManager pm = new PermissionManager ( clonedSoftware . getStorageSystem ( ) , publishedSoftwareDataClient , logicalFile , clonedSoftware . getOwner ( ) ) ; if ( ! publishedSoftwareDataClient . doesExist ( remoteDeploymentPath ) ) { if ( pm . canReadWrite ( publishedSoftwareDataClient . resolvePath ( remoteDeploymentPath ) ) ) { publishedSoftwareDataClient . mkdirs ( remoteDeploymentPath , clonedSoftware . getOwner ( ) ) ; } else { throw new PermissionException ( "User does not have permission to access the deployment path " + remoteDeploymentPath + " on the target " + "deployment system. Verify you have been granted at lease  " + PermissionType . READ_WRITE + " permission on the target execution system " + clonedSoftware . getStorageSystem ( ) . getSystemId ( ) ) ; } } else if ( ! pm . canReadWrite ( publishedSoftwareDataClient . resolvePath ( remoteDeploymentPath ) ) ) { throw new PermissionException ( "User does not have permission to access the deployment path " + remoteDeploymentPath + " on the target " + "deployment system. Verify you have been granted at lease  " + PermissionType . READ_WRITE + " permission on the target execution system " + clonedSoftware . getStorageSystem ( ) . getSystemId ( ) ) ; } return remoteDeploymentPath ; }
Calculates the {@link Software#getDeploymentPath()} to which the cloned app assets will be copied.
Calculates the { @link Software#getDeploymentPath () } to which the cloned app assets will be copied .
// resolve the path to the folder for the original apps on the app's storage system // note that this may change over time, but it's saved with the app, so that's fine.