Package org.exist.source

Examples of org.exist.source.DBSource


                                "declares a wrong mime-type");
                        return null;
                    }
                    final String controllerPath = controllerDoc.getCollection().getURI().getRawCollectionPath();
                   
                    sourceInfo = new SourceInfo(new DBSource(broker, (BinaryDocument) controllerDoc, true), "xmldb:exist://" + controllerPath);
                    sourceInfo.controllerPath = controllerPath.substring(locationUri.getCollectionPath().length());

                    return sourceInfo;
                } finally {
                    if (controllerDoc != null) {
View Full Code Here


                        {throw new ServletException("XQuery resource: " + query + " not found in database");}
                    if (sourceDoc.getResourceType() != DocumentImpl.BINARY_FILE ||
                            !"application/xquery".equals(sourceDoc.getMetadata().getMimeType()))
                        {throw new ServletException("XQuery resource: " + query + " is not an XQuery or " +
                                "declares a wrong mime-type");}
                    sourceInfo = new SourceInfo(new DBSource(broker, (BinaryDocument) sourceDoc, true),
                        locationUri.toString());
                } catch (final PermissionDeniedException e) {
                    throw new ServletException("permission denied to read module source from " + query);
                } finally {
                    if(sourceDoc != null)
View Full Code Here

            broker = brokerPool.get(user);
            final DocumentImpl resource = broker.getResource(new XmldbURI(uri), Permission.READ | Permission.EXECUTE);
            if(resource == null) {
                throw new XMLDBException(ErrorCodes.INVALID_URI, "No stored XQuery exists at: " + uri);
            }
            final Source xquerySource = new DBSource(broker, (BinaryDocument)resource, false);
            return execute(xquerySource);
        } catch(final EXistException ee) {
            throw new XMLDBException(ErrorCodes.VENDOR_ERROR, ee.getMessage(), ee);
        } catch(final PermissionDeniedException pde) {
            throw new XMLDBException(ErrorCodes.VENDOR_ERROR, pde.getMessage(), pde);
View Full Code Here

TOP

Related Classes of org.exist.source.DBSource

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.