Package net.sourceforge.yagsbook.encyclopedia.articles

Examples of net.sourceforge.yagsbook.encyclopedia.articles.FileSystemSource


            return;
        }

        Encyclopedia    enc = new Encyclopedia(new File(destPath));
        for (int s=0; s < src.length; s++) {
            enc.add(new FileSystemSource(new File(src[s])));
        }
        enc.setConfiguration(new File(configFilename));
        debug("Building encyclopedia");
        enc.build();
    }
View Full Code Here


        String      output = null;
        try {
            Encyclopedia    encyclopedia = new Encyclopedia(new File(destination));
            encyclopedia.setConfiguration(new File(localRepository+"/"+configFile));
            encyclopedia.add(new FileSystemSource(new File(localRepository+"/"+repository)));

            encyclopedia.build();
        } catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

        sourceDir.delete();
    }
   
    public void
    testLoad() throws Exception {
        FileSystemSource        source = null;

        source = new FileSystemSource(new File(sourcePath));
        assertEquals("File count in source is wrong", ARTICLES.length,
                    source.size());
       
        Hashtable   table = new Hashtable();
        for (int i=0; i < ARTICLES.length; i++) {
            String  uri = ARTICLES[i].toLowerCase();
            String  title = ARTICLES[i];
           
            table.put(uri, title);
        }
       
        Iterator    iter = source.iterator();
        while (iter.hasNext()) {
            IEntry      entry = (IEntry) iter.next();
            String      title = (String)table.get(entry.getUri());
           
            assertNotNull("Could not recognise entry ["+entry.getUri()+"]",
View Full Code Here

    public static void
    main(String args[]) throws Exception {
        Repository rep = new Repository(new File("/tmp/repository"));

        try {
            rep.add(new FileSystemSource(
                        new File("/home/sam/rpg/arsmagica/encyclopedia/src")));

            rep.dump();
        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

        try {
            Encyclopedia    e = new Encyclopedia(new File(destination));
            while (iter.hasNext()) {
                String      src = (String)iter.next();
                e.add(new FileSystemSource(new File(src)));
            }

            e.setProperties(properties);
            e.setConfiguration(new File(configPath));
            e.build();
View Full Code Here

TOP

Related Classes of net.sourceforge.yagsbook.encyclopedia.articles.FileSystemSource

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.