Package org.apache.naming.resources

Examples of org.apache.naming.resources.Resource.streamContent()


                        //
                        // we have to read the JSP twice, once to figure out the content encoding
                        // the second time to read the actual content using the correct encoding
                        //
                        item.setEncoding(Utils.getJSPEncoding(jsp.streamContent()));
                    }
                    if (highlight) {
                        request.setAttribute("highlightedContent", Utils.highlightStream(jspName, jsp.streamContent(),
                                "xhtml", item.getEncoding()));
                    } else {
View Full Code Here


                        // the second time to read the actual content using the correct encoding
                        //
                        item.setEncoding(Utils.getJSPEncoding(jsp.streamContent()));
                    }
                    if (highlight) {
                        request.setAttribute("highlightedContent", Utils.highlightStream(jspName, jsp.streamContent(),
                                "xhtml", item.getEncoding()));
                    } else {
                        request.setAttribute("content", Utils.readStream(jsp.streamContent(), item.getEncoding()));
                    }
View Full Code Here

                    }
                    if (highlight) {
                        request.setAttribute("highlightedContent", Utils.highlightStream(jspName, jsp.streamContent(),
                                "xhtml", item.getEncoding()));
                    } else {
                        request.setAttribute("content", Utils.readStream(jsp.streamContent(), item.getEncoding()));
                    }

                } else {
                    logger.error(jspName + " does not exist");
                }
View Full Code Here

        }

        // Copy data in oldRevisionContent to contentFile
        if (oldResource != null) {
            BufferedInputStream bufOldRevStream =
                new BufferedInputStream(oldResource.streamContent(),
                                        BUFFER_SIZE);

            int numBytesRead;
            byte[] copyBuffer = new byte[BUFFER_SIZE];
            while ((numBytesRead = bufOldRevStream.read(copyBuffer)) != -1) {
View Full Code Here

                if (resource != null) {


                    try {
                        binaryStream = resource.streamContent();
                    } catch (IOException e) {
                        return null;
                    }

                    if (needConvert) {
View Full Code Here

                if (resource != null) {


                    try {
                        binaryStream = resource.streamContent();
                    } catch (IOException e) {
                        return null;
                    }

                    if (needConvert) {
View Full Code Here

                    log.debug(sm.getString("webappLoader.jarDeploy", filename,
                                     destFile.getAbsolutePath()));

                    Resource jarResource = (Resource) binding.getObject();
                    if (copyJars) {
                        if (!copy(jarResource.streamContent(),
                                  new FileOutputStream(destFile)))
                            continue;
                    }

                    try {
View Full Code Here

        }

        // Copy data in oldRevisionContent to contentFile
        if (oldResource != null) {
            BufferedInputStream bufOldRevStream =
                new BufferedInputStream(oldResource.streamContent(),
                                        BUFFER_SIZE);

            int numBytesRead;
            byte[] copyBuffer = new byte[BUFFER_SIZE];
            while ((numBytesRead = bufOldRevStream.read(copyBuffer)) != -1) {
View Full Code Here

            NamingEnumeration wne = dirContext.listBindings("/META-INF/");
            Binding binding = (Binding) wne.nextElement();
            if (binding.getName().toUpperCase().equals("MANIFEST.MF")) {
                Resource resource = (Resource)dirContext.lookup
                                    ("/META-INF/" + binding.getName());
                inputStream = resource.streamContent();
                Manifest manifest = new Manifest(inputStream);
                inputStream.close();
                inputStream = null;
                ManifestResource mre = new ManifestResource
                    (sm.getString("extensionValidator.web-application-manifest"),
View Full Code Here

                if (!binding.getName().toLowerCase().endsWith(".jar")) {
                    continue;
                }
                Resource resource = (Resource)dirContext.lookup
                                        ("/WEB-INF/lib/" + binding.getName());
                Manifest jmanifest = getManifest(resource.streamContent());
                if (jmanifest != null) {
                    ManifestResource mre = new ManifestResource(
                                                binding.getName(),
                                                jmanifest,
                                                ManifestResource.APPLICATION);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.