~sword-devel/jsword/trunk

« back to all changes in this revision

Viewing changes to jsword/java/jsword/org/crosswire/jsword/book/sword/SwordBibleDriver.java

  • Committer: joe
  • Date: 2002-10-08 21:36:18 UTC
  • Revision ID: svn-v4:a88caf3b-7e0a-0410-8d0d-cecb45342206:trunk:80
big config and comment update

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
/**
19
19
 * This represents all of the SwordBibles.
 
20
 * 
 
21
 * <p><table border='1' cellPadding='3' cellSpacing='0'>
 
22
 * <tr><td bgColor='white' class='TableRowColor'><font size='-7'>
20
23
 *
21
 
 * <table border='1' cellPadding='3' cellSpacing='0' width="100%">
22
 
 * <tr><td bgColor='white'class='TableRowColor'><font size='-7'>
23
24
 * Distribution Licence:<br />
24
 
 * Project B is free software; you can redistribute it
 
25
 * JSword is free software; you can redistribute it
25
26
 * and/or modify it under the terms of the GNU General Public License,
26
27
 * version 2 as published by the Free Software Foundation.<br />
27
28
 * This program is distributed in the hope that it will be useful,
29
30
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
30
31
 * General Public License for more details.<br />
31
32
 * The License is available on the internet
32
 
 * <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, by writing to
33
 
 * <i>Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
34
 
 * MA 02111-1307, USA</i>, Or locally at the Licence link below.<br />
 
33
 * <a href='http://www.gnu.org/copyleft/gpl.html'>here</a>, or by writing to:
 
34
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 
35
 * MA 02111-1307, USA<br />
35
36
 * The copyright to this program is held by it's authors.
36
37
 * </font></td></tr></table>
37
 
 * @see <a href='http://www.eireneh.com/servlets/Web'>Project B Home</a>
38
 
 * @see <{docs.Licence}>
39
 
 * @author Joe Walker
 
38
 * @see docs.Licence
 
39
 * @author Joe Walker [joe at eireneh dot com]
 
40
 * @version $Id$
40
41
 */
41
42
public class SwordBibleDriver extends AbstractBibleDriver
42
43
{
62
63
     */
63
64
    public String[] getBibleNames()
64
65
    {
65
 
        try
66
 
        {
67
 
            if (!nested.getProtocol().equals("file"))
68
 
                throw new BookException("sword_file_only", new Object[] { dir.getProtocol() });
69
 
 
70
 
            File fdir = new File(nested.getFile());
71
 
 
72
 
            // Check that the dir exists
73
 
            if (!fdir.isDirectory())
74
 
            {
75
 
                log.debug("The directory '"+dir+"' does not exist.");
76
 
                return new String[0];
77
 
            }
78
 
 
79
 
            // List all the versions
80
 
            return fdir.list(new CustomFilenameFilter());
81
 
        }
82
 
        catch (Exception ex)
83
 
        {
84
 
            return new String[0];
85
 
        }
 
66
        if (nested == null)
 
67
        {
 
68
            log.warn("No directory set");
 
69
            return new String[0];
 
70
        }
 
71
 
 
72
        if (!nested.getProtocol().equals("file"))
 
73
        {
 
74
            log.warn("SwordBibleDriver has file: URL. Ignoring.");
 
75
            return new String[0];
 
76
        }
 
77
 
 
78
        File fdir = new File(nested.getFile());
 
79
 
 
80
        // Check that the dir exists
 
81
        if (!fdir.isDirectory())
 
82
        {
 
83
            log.debug("The directory '"+dir+"' does not exist.");
 
84
            return new String[0];
 
85
        }
 
86
 
 
87
        // List all the versions
 
88
        return fdir.list(new CustomFilenameFilter());
86
89
    }
87
90
 
88
91
    /**