org.rr0.util.news
Class SiteNews


public class SiteNews

Generates a set of news data given a updated set of files.
Generates:

Author:
Jérôme Beau
Version: 22 juin 2003 15:19:05

Inner Class Summary
 (package private) classSiteNews.HTMLParserCallBack
           

Field Summary
 private Listadded
           
 private final StringDEFAULT_DTD
           
 private final static StringDEFAULT_PROPERTIES_FILENAME
           
 private static StringdirectoryArgument
           
 private ResourceBundledocumentsBundle
           
 private LocaledocumentsLocale
           
 private StringfeedFilename
           
 private MapfileDescriptions
           
 private FilefilesDirectory
           
 private MapfileTitles
           
 private static StringhtmlFilenameArgument
           
 private DocumentParserhtmlParser
           
 private static LocalelocaleArgument
           
 (package private) final StringnewsTag
           
 private Propertiesproperties
           
 private FilepropertiesFile
           
 private static StringpropertiesFilenameArgument
           
 private static StringrssFilenameArgument
           
 private static ResourceBundletoolBundle
           
 private Listupdated
           
 private booleanverbose
           
 private static booleanverboseArgument
           
 private StringwebFilename
           

Constructor Summary
SiteNews(String propertiesFile, String htmlFilename, String rssFilename, boolean verbose, Locale locale, String directory)
           

Method Summary
 private voidanalyze(File[] directoryFiles)
           
 private StringdocumentMessage(String messageKey)
           
 private voidgenerate()
           
 private ChannelgenerateFeed()
           
 private StringgetDescription(File file)
           
 private StringgetTitle(File file)
          Read informations about a file.
 static voidmain(String[] args)
           
 private static voidparseArguments(String[] args)
           
 private voidprocessFeed(List toProcess, Channel channel, String prefix)
           
 private voidprocessWeb(List toProcess, StringBuffer webBuffer, String description)
           
 private voidreadProperties(String propertiesFilename, String directory)
           
 private ListreadWeb()
           
 private static StringtoolMessage(String messageKey)
           
 private static StringtoolMessage(String messageKey, Object messageParam)
           
 private static StringtoolMessage(String messageKey, Object messageParam0, Object messageParam1)
           
 private StringtoolMessage(String messageKey, Object messageParam0, Object messageParam1, Object messageParam2)
           
 private voidupdateProperties(File[] directoryFiles)
           
 private voidwriteFeed(Channel feed)
           
 private static voidwriteInfo(String messageKey, Object messageParam)
           
 private voidwriteVerbose(String messageKey, String messageParam)
           
 private voidwriteVerbose(String messageKey, String messageParam0, String messageParam1)
           
 private voidwriteVerbose(String messageKey, Object messageParam0, Object messageParam1, Object messageParam2)
           
 private voidwriteWeb(List lines)
           

Field Detail

added

private List added

DEFAULT_DTD

private final String DEFAULT_DTD

DEFAULT_PROPERTIES_FILENAME

private final static String DEFAULT_PROPERTIES_FILENAME

directoryArgument

private static String directoryArgument

documentsBundle

private ResourceBundle documentsBundle

documentsLocale

private Locale documentsLocale

feedFilename

private String feedFilename

fileDescriptions

private Map fileDescriptions

filesDirectory

private File filesDirectory

fileTitles

private Map fileTitles

htmlFilenameArgument

private static String htmlFilenameArgument

htmlParser

private DocumentParser htmlParser

localeArgument

private static Locale localeArgument

newsTag

final String newsTag

properties

private Properties properties

propertiesFile

private File propertiesFile

propertiesFilenameArgument

private static String propertiesFilenameArgument

rssFilenameArgument

private static String rssFilenameArgument

toolBundle

private static ResourceBundle toolBundle

updated

private List updated

verbose

private boolean verbose

verboseArgument

private static boolean verboseArgument

webFilename

private String webFilename
Constructor Detail

SiteNews

public SiteNews(String propertiesFile, String htmlFilename, String rssFilename, boolean verbose, Locale locale, String directory)
throws java.io.IOException
Method Detail

analyze

private void analyze(File[] directoryFiles)

documentMessage

private String documentMessage(String messageKey)

generate

private void generate()
throws java.io.IOException

generateFeed

private Channel generateFeed()
throws java.io.IOException

getDescription

private String getDescription(File file)

getTitle

private String getTitle(File file)
throws java.io.IOException
Read informations about a file.
HTML files are parsed to find values for
<title>
and
<meta>
data.
Parameters:
file
Returns:
Throws:
IOException

main

public static void main(String[] args)
throws java.io.IOException,
ParseException

parseArguments

private static void parseArguments(String[] args)
throws ParseException

processFeed

private void processFeed(List toProcess, Channel channel, String prefix)
throws java.io.IOException

processWeb

private void processWeb(List toProcess, StringBuffer webBuffer, String description)
throws java.io.IOException

readProperties

private void readProperties(String propertiesFilename, String directory)

readWeb

private List readWeb()
throws java.io.IOException

toolMessage

private static String toolMessage(String messageKey)

toolMessage

private static String toolMessage(String messageKey, Object messageParam)

toolMessage

private static String toolMessage(String messageKey, Object messageParam0, Object messageParam1)

toolMessage

private String toolMessage(String messageKey, Object messageParam0, Object messageParam1, Object messageParam2)

updateProperties

private void updateProperties(File[] directoryFiles)
throws java.io.IOException

writeFeed

private void writeFeed(Channel feed)
throws java.io.IOException

writeInfo

private static void writeInfo(String messageKey, Object messageParam)

writeVerbose

private void writeVerbose(String messageKey, String messageParam)

writeVerbose

private void writeVerbose(String messageKey, String messageParam0, String messageParam1)

writeVerbose

private void writeVerbose(String messageKey, Object messageParam0, Object messageParam1, Object messageParam2)

writeWeb

private void writeWeb(List lines)
throws java.io.IOException

Association Links

to Class java.lang.String

to Class java.lang.String

to Class java.util.Properties

to Class java.util.List

to Class java.util.List

to Class java.io.File

to Class java.lang.String

to Class java.util.Locale

to Class java.lang.String

to Class javax.swing.text.html.parser.DocumentParser

to Class java.lang.String

to Class java.util.Map

to Class java.util.Map

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.util.Locale

to Class java.util.ResourceBundle

to Class java.util.ResourceBundle

to Class java.io.File

to Class java.lang.String