agave-apps/apps-core/src/test/java/org/iplantc/service/apps/queue/actions/AbstractWorkerActionTest.java
/**
     * Cleans up data in the deploymentPath of the {@link StorageSystem} of the {@link Software}
     * @param software
     * @throws Exception
     */
Cleans up data in the deploymentPath of the  StorageSystem of the  Software
@param software
@throws Exception
Cleans up data in the deploymentPath of the StorageSystem of the Software @param software @throws Exception
protected void deleteRemoteSoftwareAssets(Software software) throws Exception
    {
        RemoteSystem storageSystem = software.getStorageSystem();
        RemoteDataClient remoteDataClient = null;
        try 
        {
            String homeDir = StringUtils.trimToEmpty(storageSystem.getStorageConfig().getHomeDir());
            String deploymentDir = software.getDeploymentPath();
            remoteDataClient = storageSystem.getRemoteDataClient();
            remoteDataClient.authenticate();
            if (software.isPubliclyAvailable() || deploymentDir.startsWith("/")) {
                remoteDataClient.delete(deploymentDir);
            }
            else {
                deploymentDir = deploymentDir.replace(homeDir, "");
                String[] tokens = deploymentDir.split("/");
                if (tokens.length > 0) {
                    remoteDataClient.delete(tokens[0]);
                }
            }
        }
        finally {
            try {
                if (remoteDataClient != null) {
                    remoteDataClient.disconnect();
                }
            } catch (Exception ignored) {}
        }
    }
protected void deleteRemoteSoftwareAssets ( Software software ) throws Exception { RemoteSystem storageSystem = software . getStorageSystem ( ) ; RemoteDataClient remoteDataClient = null ; try { String homeDir = StringUtils . trimToEmpty ( storageSystem . getStorageConfig ( ) . getHomeDir ( ) ) ; String deploymentDir = software . getDeploymentPath ( ) ; remoteDataClient = storageSystem . getRemoteDataClient ( ) ; remoteDataClient . authenticate ( ) ; if ( software . isPubliclyAvailable ( ) || deploymentDir . startsWith ( "/" ) ) { remoteDataClient . delete ( deploymentDir ) ; } else { deploymentDir = deploymentDir . replace ( homeDir , "" ) ; String [ ] tokens = deploymentDir . split ( "/" ) ; if ( tokens . length > 0 ) { remoteDataClient . delete ( tokens [ 0 ] ) ; } } } finally { try { if ( remoteDataClient != null ) { remoteDataClient . disconnect ( ) ; } } catch ( Exception ignored ) { } } }
Cleans up data in the deploymentPath of the {@link StorageSystem} of the {@link Software}
 @param software
 @throws Exception
Cleans up data in the deploymentPath of the { @link StorageSystem } of the { @link Software } @param software @throws Exception
// delete parent directory of deploymentPath if relative to homedir, which it should be // public systems deployment dir is a file, no need to resolve paths there. // if an absolute path, just delete the folder // delete parents of deployment path relative to home directory