Package org.exist.xmldb

Examples of org.exist.xmldb.XmldbURI


    public Vector<String> getDocumentListing() throws EXistException, PermissionDeniedException {
        DBBroker broker = null;
        try {
            broker = factory.getBrokerPool().get(user);
            final DocumentSet docs = broker.getAllXMLResources(new DefaultDocumentSet());
            final XmldbURI names[] = docs.getNames();
            final Vector<String> vec = new Vector<String>();
            for (int i = 0; i < names.length; i++)
                vec.addElement(names[i].toString());
           
            return vec;
View Full Code Here


        DBBroker broker = null;
        Collection collection = null;
        try {
            broker = factory.getBrokerPool().get(user);
            collection = broker.openCollection(collUri, Lock.READ_LOCK);
            XmldbURI id;
            final Random rand = new Random();
            boolean ok;
            do {
                ok = true;
                id = XmldbURI.create(Integer.toHexString(rand.nextInt()) + ".xml");
                // check if this id does already exist
                if (collection.hasDocument(broker, id))
                    {ok = false;}
               
                if (collection.hasSubcollection(broker, id))
                    {ok = false;}
               
            } while (!ok);
            return id.toString();
        } finally {
            if(collection != null)
                {collection.release(Lock.READ_LOCK);}
            factory.getBrokerPool().release(broker);
        }
View Full Code Here

    }
   
    @Override
    public HashMap<String, Object> getSubCollectionPermissions(String parentPath, String name) throws EXistException, PermissionDeniedException, URISyntaxException {
       
        final XmldbURI uri = XmldbURI.xmldbUriFor(parentPath);
        DBBroker broker = null;
        Collection collection = null;

        try {
            broker = factory.getBrokerPool().get(user);
View Full Code Here

        }
    }
   
    @Override
    public HashMap<String, Object> getSubResourcePermissions(String parentPath, String name) throws EXistException, PermissionDeniedException, URISyntaxException {
         final XmldbURI uri = XmldbURI.xmldbUriFor(parentPath);
        DBBroker broker = null;
        Collection collection = null;

        try {
            broker = factory.getBrokerPool().get(user);
View Full Code Here

        }  
    }
   
    @Override
    public long getSubCollectionCreationTime(String parentPath, String name) throws EXistException, PermissionDeniedException, URISyntaxException {
        final XmldbURI uri = XmldbURI.xmldbUriFor(parentPath);
        DBBroker broker = null;
        Collection collection = null;

        try {
            broker = factory.getBrokerPool().get(user);
View Full Code Here

                {throw new EXistException("Collection " + collUri + " not found");}
            if (!collection.getPermissionsNoLock().validate(user, Permission.READ))
                {throw new PermissionDeniedException("not allowed to read collection " + collUri);}
            final HashMap<XmldbURI, List<Object>> result = new HashMap<XmldbURI, List<Object>>(collection.getChildCollectionCount(broker));
            for (final Iterator<XmldbURI> i = collection.collectionIterator(broker); i.hasNext(); ) {
              final XmldbURI child = i.next();
              final XmldbURI path = collUri.append(child);
                final Collection childColl = broker.getCollection(path);
                final Permission perm = childColl.getPermissionsNoLock();
                final List<Object> tmp = new ArrayList<Object>(3);
                tmp.add(perm.getOwner().getName());
                tmp.add(perm.getGroup().getName());
View Full Code Here

      String compression = "no";
      if (((String) parameters.get(EXistOutputKeys.COMPRESS_OUTPUT)) != null) {
        compression = (String) parameters.get(EXistOutputKeys.COMPRESS_OUTPUT);
      }
      try {
        final XmldbURI docUri=XmldbURI.xmldbUriFor(docName);
        broker = factory.getBrokerPool().get(user);
        final NodeId nodeId = factory.getBrokerPool().getNodeFactory().createFromString(id);
        DocumentImpl doc;
        LOG.debug("loading doc " + docUri);
        doc = (DocumentImpl) broker.getXMLResource(docUri);
View Full Code Here

        if(LOG.isDebugEnabled()) {
            LOG.debug(String.format("moveTo: %s newName=%s", resourceXmldbUri, newName));
        }

        XmldbURI destCollection = ((MiltonCollection) rDest).getXmldbUri();
        try {
            existDocument.resourceCopyMove(destCollection, newName, Mode.MOVE);

        } catch (EXistException ex) {
            throw new ConflictException(this);
View Full Code Here

        if(LOG.isDebugEnabled()) {
            LOG.debug(String.format("copyTo: %s newName=%s", resourceXmldbUri, newName));
        }
       
        XmldbURI destCollection = ((MiltonCollection) rDest).getXmldbUri();
        try {
            existDocument.resourceCopyMove(destCollection, newName, Mode.COPY);

        } catch (EXistException ex) {
            // unable to throw new ConflictException(this);
View Full Code Here

    /**
     *  Convert % encoded string back to text
     */
    protected XmldbURI decodePath(XmldbURI uri){

        XmldbURI retval =null;

        try {
            String path = new URI(uri.toString()).getPath();

            retval = XmldbURI.xmldbUriFor(""+path, false);
View Full Code Here

TOP

Related Classes of org.exist.xmldb.XmldbURI

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.