Package org.exist

Examples of org.exist.EXistException


        try {
            createAdminAndGuestIfNotExist(broker);
        } catch(final PermissionDeniedException pde) {
            final boolean exportOnly =  (Boolean) broker.getConfiguration().getProperty(BrokerPool.PROPERTY_EXPORT_ONLY, false);
            if(!exportOnly) {
              throw new EXistException(pde.getMessage(), pde);
            }
        }
    }
View Full Code Here


        _t = __t229;
        _t = _t.getNextSibling();
       
              String namespaceURI= staticContext.getURIForPrefix(nc3.getText());
              if (namespaceURI == null)
                throw new EXistException("No namespace defined for prefix " + nc3.getText());
              qname= new QName(null, namespaceURI, null);
              qname.setNameType(ElementValue.ATTRIBUTE);
           
        break;
      }
View Full Code Here

        this.config = config;
        try {
            final SchedulerFactory schedulerFactory = new StdSchedulerFactory(getQuartzProperties());
            scheduler = schedulerFactory.getScheduler();
        } catch(final SchedulerException se) {
            throw(new EXistException("Unable to create Scheduler: " + se.getMessage(), se));
        }
    }
View Full Code Here

                if (LOG.isDebugEnabled())
                    {LOG.debug("Output directory for journal files does not exist. Creating " + f.getAbsolutePath());}
                try {
                    f.mkdirs();
                } catch (final SecurityException e) {
                    throw new EXistException("Failed to create output directory: " + f.getAbsolutePath());
                }
            }
            if (!(f.canWrite())) {
                throw new EXistException("Cannot write to journal output directory: " + f.getAbsolutePath());
            }
            this.dir = f;
        }
        if (LOG.isDebugEnabled())
            {LOG.debug("Using directory for the journal: " + dir.getAbsolutePath());}
View Full Code Here

        boolean locked = fileLock.tryLock();
        if (!locked) {
            final String lastHeartbeat =
                DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM)
                    .format(fileLock.getLastHeartbeat());
                    throw new EXistException("The journal log directory seems to be locked by another " +
                    "eXist process. A lock file: " + lck.getAbsolutePath() + " is present in the " +
                    "log directory. Last access to the lock file: " + lastHeartbeat);
        }
    }
View Full Code Here

            broker = pool.get(session.getUser());
            final XmldbURI collectionUri = path.removeLastSegment();
            final XmldbURI docUri = path.lastSegment();
            if (collectionUri==null || docUri==null) {
                transact.abort(txn);
                throw new EXistException("Illegal document path");
            }
            final Collection collection = broker.getCollection(collectionUri);
            if (collection == null) {
                transact.abort(txn);
                throw new EXistException(
                        "Collection " + collectionUri + " not found");
            }
            final DocumentImpl doc = collection.getDocument(broker, docUri);
            if(doc == null)
                {throw new EXistException("Document " + docUri + " not found");}
           
            if(doc.getResourceType() == DocumentImpl.BINARY_FILE)
                {collection.removeBinaryResource(txn, broker, doc);}
            else
                {collection.removeXMLResource(txn, broker, docUri);}
View Full Code Here

            broker = pool.get(session.getUser());
            final XmldbURI collectionUri = path.removeLastSegment();
            final XmldbURI docUri = path.lastSegment();
            if (collectionUri==null || docUri==null) {
                transact.abort(txn);
                throw new EXistException("Illegal document path");
            }
            final Collection collection = broker.getCollection(collectionUri);
            if (collection == null) {
                transact.abort(txn);
                throw new EXistException("Collection " + collectionUri + " not found");
            }
            if(!replace) {
                final DocumentImpl old = collection.getDocument(broker, docUri);
                if(old != null) {
                    transact.abort(txn);
View Full Code Here

            broker = pool.get(session.getUser());
            final XmldbURI collectionUri = path.removeLastSegment();
            final XmldbURI docUri = path.lastSegment();
            if (collectionUri==null || docUri==null) {
                transact.abort(txn);
                throw new EXistException("Illegal document path");
            }
            collection = broker.openCollection(collectionUri, Lock.WRITE_LOCK);
            if (collection == null)
                {throw new EXistException("Collection " + collectionUri
                        + " not found");}
            if (!replace) {
                final DocumentImpl old = collection.getDocument(broker, docUri);
                if (old != null)
                    {throw new PermissionDeniedException(
View Full Code Here

        try {
            broker = pool.get(session.getUser());
            // TODO check XML/Binary resource
            doc = broker.getXMLResource(name, Lock.READ_LOCK);
            if (doc == null)
                {throw new EXistException("Resource " + name + " not found");}
            if (doc.getResourceType() != DocumentImpl.BINARY_FILE)
                {throw new EXistException("Document " + name
                        + " is not a binary resource");}
            if(!doc.getPermissions().validate(session.getUser(), Permission.READ))
                {throw new PermissionDeniedException("Insufficient privileges to read resource");}
            final InputStream is = broker.getBinaryResource((BinaryDocument) doc);
            final long resourceSize = broker.getBinaryResourceSize((BinaryDocument) doc);
View Full Code Here

            if (collectionName == null)
                {collectionName = XmldbURI.ROOT_COLLECTION_URI;}
           
            collection = broker.openCollection(collectionName, Lock.READ_LOCK);
            if (collection == null)
                {throw new EXistException("collection " + collectionName
                        + " not found!");}
            final CollectionDesc desc = new CollectionDesc();
            final List<DocumentDesc> docs = new ArrayList<DocumentDesc>();
            final List<String> collections = new ArrayList<String>();
            if (collection.getPermissionsNoLock().validate(session.getUser(), Permission.READ)) {
View Full Code Here

TOP

Related Classes of org.exist.EXistException

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.