Package org.rhq.core.pluginapi.content

Examples of org.rhq.core.pluginapi.content.FileContentDelegate


     */
    private String getSHA256(File file) {
        String sha256 = null;

        try {
            FileContentDelegate fileContentDelegate = new FileContentDelegate();
            sha256 = fileContentDelegate.retrieveDeploymentSHA(file, getResourceContext().getResourceDataDirectory());
        } catch (Exception iex) {
            if (LOG.isDebugEnabled()) {
                LOG.debug("Problem calculating digest of package [" + file.getPath() + "]." + iex.getMessage());
            }
        }
View Full Code Here


            }
        }

        // Store SHA256 in the agent file if deployment was exploded
        if (deploymentFile.isDirectory()) {
            FileContentDelegate fileContentDelegate = new FileContentDelegate();
            fileContentDelegate.saveDeploymentSHA(tempFile, deploymentFile, getResourceContext()
                .getResourceDataDirectory());
        }

        // Remove temporary files created by this deployment.
        deleteTemporaryFile(backupDir);
View Full Code Here

        this.setContentContext(contentContext);
    }

    @Override
    public Set<ResourcePackageDetails> discoverDeployedPackages(PackageType type) {
        FileContentDelegate contentDelegate = getContentDelegate(type);

        Set<ResourcePackageDetails> details = null;
        if (contentDelegate != null) {
            details = contentDelegate.discoverDeployedPackages();
        }

        return details;
    }
View Full Code Here

        return details;
    }

    private FileContentDelegate getContentDelegate(PackageType type) {
        FileContentDelegate contentDelegate = contentDelegates.get(type);
        if (contentDelegate == null) {
            if (type.getName().equals("library")) {
                File deployLib = new File(this.getConfigurationPath(), "lib");
                contentDelegate = new JarContentDelegate(deployLib, type.getName());
            }
View Full Code Here

     */
    private String getSHA256(File file) {
        String sha256 = null;

        try {
            FileContentDelegate fileContentDelegate = new FileContentDelegate();
            sha256 = fileContentDelegate.retrieveDeploymentSHA(file, context.getResourceDataDirectory());
        } catch (Exception iex) {
            if (getLog().isDebugEnabled()) {
                getLog().debug("Problem calculating digest of package [" + file.getPath() + "]." + iex.getMessage());
            }
        }
View Full Code Here

        when(mockFile.exists()).thenReturn(true);
        when(mockFile.getName()).thenReturn("testFileName");

        PackageType mockPackageType = mock(PackageType.class);

        FileContentDelegate mockFileContentDelegate = mock(FileContentDelegate.class);
        PowerMockito.whenNew(FileContentDelegate.class).withArguments(any(File.class), isNull())
            .thenReturn(mockFileContentDelegate);
        when(mockFileContentDelegate.saveDeploymentSHA(any(File.class), any(File.class), any(File.class))).thenReturn(
            "abcd1234");

        //create object to test and inject required dependencies
        StandaloneManagedDeploymentComponent objectUnderTest = new StandaloneManagedDeploymentComponent();
View Full Code Here

            if (deployExploded && this.parentResourceContext != null) {
                URI deploymentURI = URI.create(deploymentName);
                // e.g.: /C:/opt/jboss-6.0.0.Final/server/default/deploy/foo.war
                String deploymentPath = deploymentURI.getPath();
                File deploymentFile = new File(deploymentPath);
                FileContentDelegate fileContentDelegate = new FileContentDelegate();

                fileContentDelegate.saveDeploymentSHA(archiveFile, deploymentFile,
                    parentResourceContext.getFutureChildResourceDataDirectory(archiveName));
            }

            // Reload the management view to pickup the ManagedDeployment for the app we just deployed.
            ManagementView managementView = this.profileServiceConnection.getManagementView();
View Full Code Here

TOP

Related Classes of org.rhq.core.pluginapi.content.FileContentDelegate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.