Package org.exist.util

Examples of org.exist.util.XMLFilenameFilter


        ums.chown(guest, guest.getPrimaryGroup());
        ums.chmod("rwxr-xr-x");

        //store sample files as guest
        Collection testCollectionAsGuest = DatabaseManager.getCollection(ROOT_URI + "/" + TEST_COLLECTION);
        File files[] = getShakespeareSamplesDirectory().listFiles(new XMLFilenameFilter());
        for(File file : files) {
            XMLResource res = (XMLResource) testCollectionAsGuest.createResource(file.getName(), "XMLResource");
            res.setContent(file);
            testCollectionAsGuest.storeResource(res);
        }
View Full Code Here


      (CollectionManagementService) root.getService("CollectionManagementService", "1.0");
    testCollection = service.createCollection("test");
    Assert.assertNotNull(testCollection);
       
    File dir = new File(TEST_DIR);
    files = dir.listFiles(new XMLFilenameFilter());
    for (File file : files) {
      XMLResource resource = (XMLResource) testCollection.createResource(file.getName(), "XMLResource");
      resource.setContent(file);
      testCollection.storeResource(resource);
    }
View Full Code Here

               
                TransactionManager transact = pool.getTransactionManager();
                Txn transaction = transact.beginTransaction();
               
                System.out.println("Transaction started ...");
                XMLFilenameFilter filter = new XMLFilenameFilter();
                File files[] = dir.listFiles(filter);
               
                File f;
                IndexInfo info;
                // store some documents into the test collection
View Full Code Here

    private Collection rootCollection;
    protected abstract String getDirectory();

    @Test
    public void runXMLBasedTests() throws TransformerException {
      XMLFilenameFilter filter = new XMLFilenameFilter();
     
        File dir = new File(getDirectory());
        File[] files;
        if (dir.isDirectory())
          files = dir.listFiles(filter);
        else if (filter.accept(dir.getParentFile(), dir.getName()))
          files = new File[] {dir};
        else
          return;

        try {
View Full Code Here

            File existDir = existHome==null ? new File(".") : new File(existHome);
            String directory = "samples/shakespeare";
            File dir = new File(existDir, directory);

            // store some documents.
            for(File f : dir.listFiles(new XMLFilenameFilter())) {
                IndexInfo info = root.validateXMLResource(transaction, broker, XmldbURI.create(f.getName()), new InputSource(f.toURI().toASCIIString()));
                root.store(transaction, broker, info, new InputSource(f.toURI().toASCIIString()), false);
            }

            IndexInfo info = root.validateXMLResource(transaction, broker, XmldbURI.create("nested.xml"), NESTED_XML);
View Full Code Here

        final CollectionManagementService service = (CollectionManagementService) colTest.getService("CollectionManagementService", "1.0");
        final Collection testCollection = service.createCollection("test");
        UserManagementService ums = (UserManagementService) testCollection.getService("UserManagementService", "1.0");
        ums.chmod("rwxr-xr-x");

        final File files[] = getShakespeareSamplesDirectory().listFiles(new XMLFilenameFilter());

        //store the samples
        final List<String> storedResourceNames = new ArrayList<String>();
        for(File file : files) {
            Resource res = storeResourceFromFile(file, testCollection);
View Full Code Here

            String existHome = System.getProperty("exist.home");
            File existDir = existHome==null ? new File(".") : new File(existHome);
            File dir = new File(existDir, "samples/shakespeare");
            if (!dir.canRead())
                throw new IOException("Unable to read samples directory");
            File[] files = dir.listFiles(new XMLFilenameFilter());
            for (File file : files) {
                System.out.println("Create resource from "+file.getAbsolutePath());
                resource = (XMLResource) testCollection.createResource(file.getName(), "XMLResource");
                resource.setContent(file);
                testCollection.storeResource(resource);
View Full Code Here

TOP

Related Classes of org.exist.util.XMLFilenameFilter

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.