Package org.exist

Examples of org.exist.EXistException


            broker = factory.getBrokerPool().get(user);
           
            xquery = (BinaryDocument)broker.getResource(XmldbURI.createInternal(pathToQuery), Lock.READ_LOCK);
           
            if(xquery == null) {
                throw new EXistException("Resource " + pathToQuery + " not found");
            }

            if(xquery.getResourceType() != DocumentImpl.BINARY_FILE) {
                throw new EXistException("Document " + pathToQuery + " is not a binary resource");
            }

            if(!xquery.getPermissions().validate(user, Permission.READ | Permission.EXECUTE)) {
                throw new PermissionDeniedException("Insufficient privileges to access resource");
            }
View Full Code Here


        try {
            broker = factory.getBrokerPool().get(user);
            collection = broker.openCollection(docUri.removeLastSegment(), Lock.WRITE_LOCK);
            if (collection == null) {
                transact.abort(transaction);
                throw new EXistException("Collection " + docUri.removeLastSegment() + " not found");
            }
            // keep the write lock in the transaction
            transaction.registerLock(collection.getLock(), Lock.WRITE_LOCK);

            final DocumentImpl doc = collection.getDocument(broker, docUri.lastSegment());
            if (doc == null) {
                transact.abort(transaction);
                throw new EXistException("Document " + docUri + " not found");
            }
           
            if(doc.getResourceType() == DocumentImpl.BINARY_FILE)
                {collection.removeBinaryResource(transaction, broker, doc);}
            else
View Full Code Here

                    manager.deleteAccount(name);
                    return null;
                }
            });
        } catch (final URISyntaxException use) {
            throw new EXistException(use.getMessage(), use);
        }
       
        return true;
    }
View Full Code Here

        DBBroker broker = null;
        try {
            broker = factory.getBrokerPool().get(user);
            final QueryResult qr = factory.resultSets.getResult(resultId);
            if (qr == null)
                {throw new EXistException("result set unknown or timed out");}
            qr.touch();
            final Item item = qr.result.itemAt(num);
            if (item == null)
                {throw new EXistException("index out of range");}
           
            if(Type.subTypeOf(item.getType(), Type.NODE)) {
                final NodeValue nodeValue = (NodeValue)item;
                final Serializer serializer = broker.getSerializer();
                serializer.reset();
View Full Code Here

      DBBroker broker = null;
      try {
        broker = factory.getBrokerPool().get(user);
        final QueryResult qr = factory.resultSets.getResult(resultId);
        if (qr == null)
          {throw new EXistException("result set unknown or timed out: " + resultId);}
        qr.touch();
        final Item item = qr.result.itemAt(num);
        if (item == null)
          {throw new EXistException("index out of range");}

        final HashMap<String, Object> result = new HashMap<String, Object>();
        VirtualTempFile vtempFile = new VirtualTempFile(MAX_DOWNLOAD_CHUNK_SIZE,MAX_DOWNLOAD_CHUNK_SIZE);
        vtempFile.setTempPrefix("eXistRPCC");
        vtempFile.setTempPostfix(".xml");
View Full Code Here

        DBBroker broker = null;
        try {
            broker = factory.getBrokerPool().get(user);
            final QueryResult qr = factory.resultSets.getResult(resultId);
            if (qr == null)
                {throw new EXistException("result set unknown or timed out");}
            qr.touch();
            final Serializer serializer = broker.getSerializer();
            serializer.reset();
            serializer.setProperties(qr.serialization);
           
View Full Code Here

      DBBroker broker = null;
      try {
        broker = factory.getBrokerPool().get(user);
        final QueryResult qr = factory.resultSets.getResult(resultId);
        if (qr == null)
          {throw new EXistException("result set unknown or timed out");}
        qr.touch();
        final Serializer serializer = broker.getSerializer();
        serializer.reset();
        for (final Map.Entry<Object, Object> entry : qr.serialization.entrySet()) {
          parameters.put(entry.getKey().toString(), entry.getValue().toString());
View Full Code Here

                    manager.addAccount(u);
                    return null;
                }
            });
        } catch(final URISyntaxException use) {
            throw new EXistException(use.getMessage(), use);
        }
       
        return true;
    }
View Full Code Here

                public Boolean withBroker(final DBBroker broker) throws EXistException, URISyntaxException, PermissionDeniedException {
                    return manager.updateAccount(account);
                }
            });
        } catch (final URISyntaxException use) {
            throw new EXistException(use.getMessage(), use);
        }
    }
View Full Code Here

                        return null;
                    }
                });
                return true;
            } catch (final URISyntaxException use) {
                throw new EXistException(use.getMessage(), use);
            }
        }
       
      return false;
    }
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.