Interface NewsService

  • All Known Implementing Classes:
    NewsServiceImpl

    public interface NewsService
    Encapsulate access to the news texts.
    Author:
    mhwood
    • Method Detail

      • readNewsFile

        String readNewsFile​(String newsFile)
        Reads news from a text file.
        Parameters:
        newsFile - name of the news file to read in, relative to the news file path.
        Returns:
        contents
      • writeNewsFile

        String writeNewsFile​(String newsFile,
                             String news)
        Writes news to a text file.
        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

        String getNewsFilePath()
        Get the path for the news files.
        Returns:
        path
      • validate

        boolean validate​(String newsName)
        Check if the newsName is an acceptable file name
        Parameters:
        newsName - news name
        Returns:
        true if the newsName is valid