Package org.dspace.core
Class NewsServiceImpl
- java.lang.Object
-
- org.dspace.core.NewsServiceImpl
-
- All Implemented Interfaces:
NewsService
public class NewsServiceImpl extends Object implements NewsService
Encapsulate access to the news texts.- Author:
- mhwood
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNewsServiceImpl()Not instantiable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<String>addLocalesToAcceptableFilenames(List<String> acceptableFilenames)StringgetNewsFilePath()Get the path for the news files.StringreadNewsFile(String newsFile)Reads news from a text file.voidsetAcceptableFilenames(List<String> acceptableFilenames)booleanvalidate(String newsName)Check if the newsName is an acceptable file nameStringwriteNewsFile(String newsFile, String news)Writes news to a text file.
-
-
-
Method Detail
-
addLocalesToAcceptableFilenames
protected List<String> addLocalesToAcceptableFilenames(List<String> acceptableFilenames)
-
readNewsFile
public String readNewsFile(String newsFile)
Description copied from interface:NewsServiceReads news from a text file.- Specified by:
readNewsFilein interfaceNewsService- Parameters:
newsFile- name of the news file to read in, relative to the news file path.- Returns:
- contents
-
writeNewsFile
public String writeNewsFile(String newsFile, String news)
Description copied from interface:NewsServiceWrites news to a text file.- Specified by:
writeNewsFilein interfaceNewsService- Parameters:
newsFile- name of the news file to read in, relative to the news file path.news- the text to be written to the file.- Returns:
- string
-
getNewsFilePath
public String getNewsFilePath()
Description copied from interface:NewsServiceGet the path for the news files.- Specified by:
getNewsFilePathin interfaceNewsService- Returns:
- path
-
validate
public boolean validate(String newsName)
Description copied from interface:NewsServiceCheck if the newsName is an acceptable file name- Specified by:
validatein interfaceNewsService- Parameters:
newsName- news name- Returns:
- true if the newsName is valid
-
-