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 Details

    • NewsServiceImpl

      protected NewsServiceImpl()
      Not instantiable.
  • Method Details

    • setAcceptableFilenames

      public void setAcceptableFilenames(List<String> acceptableFilenames)
    • addLocalesToAcceptableFilenames

      protected List<String> addLocalesToAcceptableFilenames(List<String> acceptableFilenames)
    • readNewsFile

      public String readNewsFile(String newsFile)
      Description copied from interface: NewsService
      Reads news from a text file.
      Specified by:
      readNewsFile in interface NewsService
      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: NewsService
      Writes news to a text file.
      Specified by:
      writeNewsFile in interface NewsService
      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: NewsService
      Get the path for the news files.
      Specified by:
      getNewsFilePath in interface NewsService
      Returns:
      path
    • validate

      public boolean validate(String newsName)
      Description copied from interface: NewsService
      Check if the newsName is an acceptable file name
      Specified by:
      validate in interface NewsService
      Parameters:
      newsName - news name
      Returns:
      true if the newsName is valid