Package org.rhq.core.pluginapi.content

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


            //full path or not.
            File contentCopy = new File(tempDir, archiveFile.getName());
       
            os = new BufferedOutputStream(new FileOutputStream(contentCopy));
            ContentContext contentContext = resourceContext.getContentContext();
            ContentServices contentServices = contentContext.getContentServices();
           
            if (resourceExists) {
                contentServices.downloadPackageBits(contentContext, key, os, true);
            } else {
                contentServices.downloadPackageBitsForChildResource(contentContext, resourceType.getName(), key, os);
            }
           
            return contentCopy;
        } catch (IOException e) {
            throw new IllegalStateException("Failed to copy the deployed archive to destination.", e);
View Full Code Here


        when(objectUnderTest.getResourceContext()).thenReturn(mockResourceContext);
        when(mockResourceContext.getTemporaryDirectory()).thenReturn(tempDirectory);

        ContentContext mockContentContext = mock(ContentContext.class);
        when(mockResourceContext.getContentContext()).thenReturn(mockContentContext);
        ContentServices mockContentServices = mock(ContentServices.class);
        when(mockContentContext.getContentServices()).thenReturn(mockContentServices);

        when(objectUnderTest.isWebApplication(any(File.class))).thenReturn(Boolean.TRUE);

        //run code under test
View Full Code Here

            File newFile = new File(this.scriptsDataDir, newName);
            String newFileAbsolutePath = newFile.getAbsolutePath();

            // download the file from the server
            ContentContext contentContext = this.resourceContext.getContentContext();
            ContentServices contentServices = contentContext.getContentServices();
            ResourceType newChildResourceType = report.getResourceType();
            FileOutputStream fos = new FileOutputStream(newFile);
            BufferedOutputStream outputStream = new BufferedOutputStream(fos);
            try {
                contentServices.downloadPackageBitsForChildResource(contentContext, newChildResourceType.getName(),
                    newDetails.getKey(), outputStream);
            } finally {
                outputStream.close();
            }
View Full Code Here

TOP

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

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.