org.crosswire.jsword.view.web
Class DownloadSet

java.lang.Object
  extended by org.crosswire.jsword.view.web.DownloadSet
All Implemented Interfaces:
Comparable

public class DownloadSet
extends Object
implements Comparable

A helper for the download.jsp page.

Distribution Licence:
JSword is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
The License is available on the internet here, or by writing to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
The copyright to this program is held by it's authors.

Version:
$Id: DownloadSet.java,v 1.4 2004/11/07 22:00:09 joe Exp $
Author:
Joe Walker [joe at eireneh dot com]
See Also:
Licence

Field Summary
static String BIN_TGZ
           
static String BIN_ZIP
           
private  boolean datesort
           
private static DateFormat DF_DISK
           
private static DateFormat DF_USER
           
static String DOC_TGZ
           
static String DOC_ZIP
           
private  String localprefix
           
protected static Logger log
          The log stream
private static NumberFormat NF
           
private  String setname
           
static String SRC_TGZ
           
static String SRC_ZIP
           
private static String TEST_PREFIX
           
private static String TEST_SUFFIX
           
private  String webprefix
           
 
Constructor Summary
private DownloadSet(String localprefix, String webprefix, String setname, boolean datesort)
          Create a set of downloads
 
Method Summary
 int compareTo(Object obj)
           
 String getDateString()
          When was the set of files created (using the file name string)
static DownloadSet[] getDownloadSets(String localprefix, String webprefix, boolean datesort)
          Get an Iterator over all the Downloads in the specified Directory
 String getLinkString(String extension)
          Get a short HTML string for the download link.
 String getVersionString()
          What is the version number (using the file name string)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BIN_ZIP

public static final String BIN_ZIP
See Also:
Constant Field Values

BIN_TGZ

public static final String BIN_TGZ
See Also:
Constant Field Values

SRC_ZIP

public static final String SRC_ZIP
See Also:
Constant Field Values

SRC_TGZ

public static final String SRC_TGZ
See Also:
Constant Field Values

DOC_ZIP

public static final String DOC_ZIP
See Also:
Constant Field Values

DOC_TGZ

public static final String DOC_TGZ
See Also:
Constant Field Values

datesort

private boolean datesort

webprefix

private String webprefix

localprefix

private String localprefix

setname

private String setname

TEST_PREFIX

private static final String TEST_PREFIX
See Also:
Constant Field Values

TEST_SUFFIX

private static final String TEST_SUFFIX
See Also:
Constant Field Values

NF

private static final NumberFormat NF

DF_DISK

private static final DateFormat DF_DISK

DF_USER

private static final DateFormat DF_USER

log

protected static final Logger log
The log stream

Constructor Detail

DownloadSet

private DownloadSet(String localprefix,
                    String webprefix,
                    String setname,
                    boolean datesort)
Create a set of downloads

Method Detail

getDownloadSets

public static DownloadSet[] getDownloadSets(String localprefix,
                                            String webprefix,
                                            boolean datesort)
                                     throws IOException
Get an Iterator over all the Downloads in the specified Directory

Throws:
IOException

compareTo

public int compareTo(Object obj)
Specified by:
compareTo in interface Comparable

getDateString

public String getDateString()
                     throws ParseException
When was the set of files created (using the file name string)

Throws:
ParseException

getVersionString

public String getVersionString()
What is the version number (using the file name string)


getLinkString

public String getLinkString(String extension)
Get a short HTML string for the download link. Purists would complain that this is UI specific code embedded where it ought not be. So such I would argue - rewrite this so that it still works (not easy given the JSP/XML use) and so that it is just as simple and so that it can actually be reused in a more general UI.


Copyright ? 2003-2004