Package org.apache.excalibur.source

Examples of org.apache.excalibur.source.Source


        String publicationId = url.substring(0, slashIndex);
        url = url.substring(publicationId.length());

        SourceResolver resolver = null;
        Policy policy = null;
        Source source = null;
        try {
            resolver = (SourceResolver) getManager().lookup(SourceResolver.ROLE);

            String policyUrl = publicationId + "/policies" + url + ".acml";
            getLogger().debug("Policy URL: " + policyUrl);
            source = resolver.resolveURI("cocoon://" + policyUrl);
            Document document = DocumentHelper.readDocument(source.getInputStream());
            policy = new PolicyBuilder(accreditableManager).buildPolicy(document);

        } catch (Exception e) {
            throw new AccessControlException(e);
        } finally {
View Full Code Here


    /**
     * @see org.apache.avalon.framework.activity.Initializable#initialize()
     */
    public void initialize() throws Exception {
        SourceResolver resolver = null;
        Source contextSource = null;
        File contextDir;
        try {
            resolver = (SourceResolver) getManager().lookup(SourceResolver.ROLE);
            contextSource = resolver.resolveURI("context:///");
            contextDir = SourceUtil.getFile(contextSource);
View Full Code Here

            if (configurationDirectoryPath == null) {
                throw new AccessControlException("Configuration directory not set!");
            }

            Source source = null;
            SourceResolver resolver = null;
            File directory;
            try {

                getLogger().debug(
                        "Configuration directory Path: [" + configurationDirectoryPath + "]");

                resolver = (SourceResolver) getManager().lookup(SourceResolver.ROLE);
                source = resolver.resolveURI(configurationDirectoryPath);

                getLogger().debug("Configuration directory URI: " + source.getURI());
                directory = new File(new URI(NetUtils.encodePath(source.getURI())));
            } catch (Exception e) {
                throw new AccessControlException(e);
            } finally {
                if (resolver != null) {
                    if (source != null) {
View Full Code Here

        Map objectModel,
        String source,
        Parameters params)
        throws IOException, SAXException, ProcessingException, ServiceException {
        // Get absolute path of sitemap directory
        Source input_source = resolver.resolveURI("");
        String sitemapPath = input_source.getURI();
        sitemapPath = sitemapPath.substring(5); // Remove "file:" protocol
        getLogger().debug(".act(): Absolute Sitemap Directory: " + sitemapPath);
        getLogger().debug(".act(): Absolute XML Root Directory: " + sitemapPath + xmlRoot);
        getLogger().debug(".act(): Absolute XSL Root Directory: " + sitemapPath + xslRoot);
        getLogger().debug(".act(): Absolute XSD Root Directory: " + sitemapPath + xsdRoot);
View Full Code Here

     */
    public File getPoliciesDirectory() throws AccessControlException {

        if (policiesDirectory == null) {
            SourceResolver resolver = null;
            Source source = null;
            File directory;

            try {
                resolver = (SourceResolver) getServiceManager().lookup(SourceResolver.ROLE);
                source = resolver.resolveURI(policiesDirectoryUri);
                getLogger().debug("Policies directory source: [" + source.getURI() + "]");
                directory = new File(new URI(NetUtils.encodePath(source.getURI())));
            } catch (final Exception e) {
                throw new AccessControlException("Resolving policies directory failed: ", e);
            } finally {
                if (resolver != null) {
                    if (source != null) {
View Full Code Here

   (non-Javadoc)
   * @see org.apache.lenya.cms.cocoon.transformation.AbstractDOMTransformer#transform(org.w3c.dom.Document)
   */
    protected Document transform(Document doc) {
        try {
            Source input_source = this.resolver.resolveURI("");
            String sitemapPath = input_source.getURI();
            getLogger().debug("Absolute SITEMAP Directory: " + sitemapPath);

            String href = this.parameters.getParameter("href", null);

            if (href != null) {
View Full Code Here

   */
    protected Publication getPublication(String url) throws AccessControlException {
        getLogger().debug("Building publication");

        Publication publication;
        Source source = null;
        SourceResolver resolver = null;

        try {
            resolver = (SourceResolver) serviceManager.lookup(SourceResolver.ROLE);
            source = resolver.resolveURI("context:///");
View Full Code Here

     * @throws BuildException if an error occurs.
     */
    protected Object buildObject(String sourceUri, InputStreamBuilder builder)
        throws MalformedURLException, IOException, SourceNotFoundException, BuildException {
        Object value = null;
        Source source = null;
        try {
            source = getResolver().resolveURI(sourceUri);
            if (source.exists()) {
                InputStream stream = source.getInputStream();
                value = builder.build(stream);
            }
        } finally {
            if (source != null) {
                getResolver().release(source);
View Full Code Here

     * @throws IOException when an error occurs.
     */
    protected SourceValidity getSourceValidity(String sourceUri)
        throws MalformedURLException, IOException {
        SourceValidity sourceValidity;
        Source source = null;
        try {
            source = getResolver().resolveURI(sourceUri);
            sourceValidity = source.getValidity();
        } finally {
            if (source != null) {
                getResolver().release(source);
            }
        }
View Full Code Here

     * @throws MalformedURLException when something went wrong.
     * @throws IOException when something went wrong.
     */
    public static String generateKey(SourceResolver resolver, String webappUrl)
        throws MalformedURLException, IOException {
        Source source = null;
        String key;
        try {
            source = resolver.resolveURI("context:///");
            key = source.getURI() + "_" + webappUrl;
        }
        finally {
            if (source != null) {
                resolver.release(source);
            }
View Full Code Here

TOP

Related Classes of org.apache.excalibur.source.Source

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.