Examples of URLSource


Examples of org.apache.excalibur.source.impl.URLSource

            this.getLogger().debug( "Creating source object for " + location );
        }

        final int protocolPos = location.indexOf("://");
        final URL url = this.urlFactory.getURL(location.substring(protocolPos+3));
        final URLSource source = new org.apache.excalibur.source.impl.URLSource();
        source.init(url, parameters);
        return source;
    }
View Full Code Here

Examples of org.apache.excalibur.source.impl.URLSource

    File tempFile;

    protected void setUp() throws Exception
    {
        super.setUp();
        m_urlSource = new URLSource();

        tempFile = File.createTempFile( "filesource", "test-exists" );
  FileOutputStream out = new FileOutputStream(tempFile);
  out.write(1);
  out.close();
View Full Code Here

Examples of org.apache.excalibur.source.impl.URLSource

            this.classpath = (String)context.get(Constants.CONTEXT_CLASSPATH);
            this.workDir = (File)context.get(Constants.CONTEXT_WORK_DIR);
            try {
                // FIXME: add a configuration option for the refresh delay.
                // for now, hard-coded to 1 second.
                URLSource urlSource = new URLSource();
                urlSource.init((URL) context.get(Constants.CONTEXT_CONFIG_URL), null);
                this.configurationFile = new DelayedRefreshSourceWrapper(urlSource,
                                                                         1000L);

            } catch (IOException e) {
                throw new ContextException("Could not open configuration file.", e);
View Full Code Here

Examples of org.apache.excalibur.source.impl.URLSource

            this.classpath = (String)context.get(Constants.CONTEXT_CLASSPATH);
            this.workDir = (File)context.get(Constants.CONTEXT_WORK_DIR);
            try {
                // FIXME: add a configuration option for the refresh delay.
                // for now, hard-coded to 1 second.
                URLSource urlSource = new URLSource();
                urlSource.init((URL) context.get(Constants.CONTEXT_CONFIG_URL), null);
                this.configurationFile = new DelayedRefreshSourceWrapper(urlSource,
                                                                         1000L);

            } catch (IOException e) {
                throw new ContextException("Could not open configuration file.", e);
View Full Code Here

Examples of org.apache.excalibur.source.impl.URLSource

            this.classpath = (String)context.get(Constants.CONTEXT_CLASSPATH);
            this.workDir = (File)context.get(Constants.CONTEXT_WORK_DIR);
            try {
                // FIXME : add a configuration option for the refresh delay.
                // for now, hard-coded to 1 second.
                URLSource urlSource = new URLSource();
                urlSource.init((URL) context.get(Constants.CONTEXT_CONFIG_URL), null);
                this.configurationFile = new DelayedRefreshSourceWrapper(urlSource,
                                                                         1000L);

            } catch (IOException ioe) {
                throw new ContextException("Could not open configuration file.", ioe);
View Full Code Here

Examples of org.apache.excalibur.source.impl.URLSource

            this.classpath = (String)context.get(Constants.CONTEXT_CLASSPATH);
            this.workDir = (File)context.get(Constants.CONTEXT_WORK_DIR);
            try {
                // FIXME : add a configuration option for the refresh delay.
                // for now, hard-coded to 1 second.
                URLSource urlSource = new URLSource();
                urlSource.init((URL)context.get(Constants.CONTEXT_CONFIG_URL), null);
                this.configurationFile = new DelayedRefreshSourceWrapper(urlSource,
                    1000L
                );

            } catch (IOException ioe) {
View Full Code Here

Examples of org.apache.excalibur.source.impl.URLSource

            this.classpath = (String)context.get(Constants.CONTEXT_CLASSPATH);
            this.workDir = (File)context.get(Constants.CONTEXT_WORK_DIR);
            try {
                // FIXME : add a configuration option for the refresh delay.
                // for now, hard-coded to 1 second.
                URLSource urlSource = new URLSource();
                urlSource.init((URL)context.get(Constants.CONTEXT_CONFIG_URL), null);
                this.configurationFile = new DelayedRefreshSourceWrapper(urlSource,
                    1000L
                );

            } catch (IOException ioe) {
View Full Code Here

Examples of org.exist.source.URLSource

                    if( queryUri.startsWith( XmldbURI.XMLDB_URI_PREFIX ) ) {
                        final Resource resource = base.getResource( queryUri );
                        source = new BinarySource( (byte[])resource.getContent(), true );
                    } else {
                        source = new URLSource( new URL( queryUri ) );
                    }

                } else if( queryFile != null ) {
                    log( "XQuery file " + queryFile.getAbsolutePath(), Project.MSG_DEBUG );
                    source = new FileSource( queryFile, "UTF-8", true );
View Full Code Here

Examples of org.exist.source.URLSource

    private void executeXProc(final DBBroker broker, final DocumentImpl resource,
            final HttpServletRequest request, final HttpServletResponse response,
            final Properties outputProperties, final String servletPath, final String pathInfo)
            throws XPathException, BadRequestException, PermissionDeniedException {

        final URLSource source = new URLSource(this.getClass().getResource("run-xproc.xq"));
        final XQuery xquery = broker.getXQueryService();
        final XQueryPool pool = xquery.getXQueryPool();
        XQueryContext context;
        CompiledXQuery compiled = pool.borrowCompiledXQuery(broker, source);
        if (compiled == null) {
            context = xquery.newContext(AccessContext.REST);
        } else {
            context = compiled.getContext();
        }

        context.declareVariable("pipeline", resource.getURI().toString());
       
        final String stdin = request.getParameter("stdin");
        context.declareVariable("stdin", stdin == null ? "" : stdin);

        final String debug = request.getParameter("debug");
        context.declareVariable("debug", debug == null ? "0" : "1");

        final String bindings = request.getParameter("bindings");
        context.declareVariable("bindings", bindings == null ? "<bindings/>" : bindings);

        final String autobind = request.getParameter("autobind");
        context.declareVariable("autobind", autobind == null ? "0" : "1");

        final String options = request.getParameter("options");
        context.declareVariable("options", options == null ? "<options/>" : options);

        // TODO: don't hardcode this?
        context.setModuleLoadPath(
                XmldbURI.EMBEDDED_SERVER_URI.append(
                resource.getCollection().getURI()).toString());

        context.setStaticallyKnownDocuments(
                new XmldbURI[]{resource.getCollection().getURI()});

        final HttpRequestWrapper reqw = declareVariables(context, null, request, response);
        reqw.setServletPath(servletPath);
        reqw.setPathInfo(pathInfo);
        if (compiled == null) {
            try {
                compiled = xquery.compile(context, source);
            } catch (final IOException e) {
                throw new BadRequestException("Failed to read query from "
                        + source.getURL(), e);
            }
        }

        try {
            final Sequence result = xquery.execute(compiled, null, outputProperties);
View Full Code Here

Examples of org.exist.source.URLSource

  URLSource entryByIdSource;
  URLSource getFeedSource;

  /** Creates a new instance of AtomProtocol */
  public AtomFeeds() {
    entryByIdSource = new URLSource(this.getClass().getResource(
        "entry-by-id.xq"));
    getFeedSource = new URLSource(this.getClass()
        .getResource("get-feed.xq"));
  }
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.