src/main/java/edu/bu/met/cs665/FooterPackage/NewCustFooter.java
/**
     * This method will output a legal disclaimer which is
     * saved in a text file. Scanner is used to scan the document
     * and will saved it to an arraylist
     * @exception IOException
     */
This method will output a legal disclaimer which is
saved in a text file. Scanner is used to scan the document
and will saved it to an arraylist
@exception IOException
This method will output a legal disclaimer which is saved in a text file . Scanner is used to scan the document and will saved it to an arraylist @exception IOException
@Override
    public void LegalDisclaimer() throws IOException {
        ArrayList<String> legal = new ArrayList<>();
        Random r = new Random();
        try (Scanner s = new Scanner(new FileReader("src\\main\\java\\edu\\bu\\met\\cs665\\FooterPackage\\NewsLetterFooter"))) {
            while (s.hasNext()) {
                legal.add(s.nextLine());
            }
            int randomIndex = (int) (Math.random() * legal.size());
            String randomName = legal.get(randomIndex);
            System.out.println(randomName);
        }
    }
@ Override public void LegalDisclaimer ( ) throws IOException { ArrayList < String > legal = new ArrayList < > ( ) ; Random r = new Random ( ) ; try ( Scanner s = new Scanner ( new FileReader ( "src\\main\\java\\edu\\bu\\met\\cs665\\FooterPackage\\NewsLetterFooter" ) ) ) { while ( s . hasNext ( ) ) { legal . add ( s . nextLine ( ) ) ; } int randomIndex = ( int ) ( Math . random ( ) * legal . size ( ) ) ; String randomName = legal . get ( randomIndex ) ; System . out . println ( randomName ) ; } }
This method will output a legal disclaimer which is
 saved in a text file.
This method will output a legal disclaimer which is saved in a text file .
// Pick one at random // Output the result