/** This class was designed to keep track of a web site's information. It does nothing but set and access bits of information about the site, including how to manage it if applicable. It HAS been tested. @author Travis Zimmerman @version 1.0 File Name: Site.java */ import java.io.Serializable; public class Site implements Serializable { /** Creates a site with the specified address (URL) @param anAddress is the site address (URL) */ public Site(String anAddress) { address = anAddress; company = "Not specified."; topic = "Not specified."; designer = "Not specified."; startDate = "Not specified."; webmasterEmailAddress = "Not specified."; hostedBy = "Not specified."; hostAddress = "Not specified."; hostUserName = "Not specified."; hostPassword = "Not specified."; ftpAddress = "Not specified."; ftpUserName = "Not specified."; ftpPassword = "Not specified."; } /** Sets the company the site is for @param aCompany is the company the site is for */ public void setCompany(String aCompany) { company = aCompany; } /** Sets the topic of the site @param aTopic is the site's topic */ public void setTopic(String aTopic) { topic = aTopic; } /** Sets the designer (company) of the site @param aDesigner is the company that designed the site */ public void setDesigner(String aDesigner) { designer = aDesigner; } /** Sets the start date of the site (the day of launch) @param aDate is the start date as a string */ public void setStartDate(String aDate) { startDate = aDate; } /** Sets the webmaster's email address @param anAddress is the email address of the webmaster */ public void setWebmasterEmailAddress(String anAddress) { webmasterEmailAddress = anAddress; } /** Sets the company that hosts the site @param aHost is the company that hosts the site */ public void setHost(String aHost) { hostedBy = aHost; } /** Sets the address (URL) of the company that hosts the site @param anAddress is the address (URL) of the company that hosts the site */ public void setHostAddress(String anAddress) { hostAddress = anAddress; } /** Sets the user name required to login to the host's site and admin the site @param aUserName is the user name to login to the host's site */ public void setHostUserName(String aUserName) { hostUserName = aUserName; } /** Sets the password required to login to the host's site and admin the site @param aPassword is the password to login to the host's site */ public void setHostPassword(String aPassword) { hostPassword = aPassword; } /** Sets the address (URL) to login to the site's FTP account @param anAddress is the address (URL) to login to the site's FTP account */ public void setFTPAddress(String anAddress) { ftpAddress = anAddress; } /** Sets the user name required to login to the site's FTP account @param aUserName is the user name required to login to the FTP */ public void setFTPUserName(String aUserName) { ftpUserName = aUserName; } /** Sets the password required to login to the site's FTP account @param aPassword is the password required to login to the FTP */ public void setFTPPassword(String aPassword) { ftpPassword = aPassword; } //////////////////////////////accessors///////////////////////////////////// /** Gets the site address (URL) @return the address (URL) of the site */ public String getAddress() { return address; } /** Gets the company the site is for @retrun the company the site is for */ public String getCompany() { return company; } /** Gets the topic of the site @return the site's topic */ public String getTopic() { return topic; } /** Gets the designer (company) of the site @retrun the company that designed the site */ public String getDesigner() { return designer; } /** Gets the start date of the site (the day of launch) @return the start date as a string */ public String getStartDate() { return startDate; } /** Gets the webmaster's email address @return the email address of the webmaster */ public String getWebmasterEmailAddress() { return webmasterEmailAddress; } /** Gets the company that hosts the site @return the company that hosts the site */ public String getHost() { return hostedBy; } /** Gets the address (URL) of the company that hosts the site @return the address (URL) of the company that hosts the site */ public String getHostAddress() { return hostAddress; } /** Gets the user name required to login to the host's site and admin the site @return the user name to login to the host's site */ public String getHostUserName() { return hostUserName; } /** Gets the password required to login to the host's site and admin the site @return the password to login to the host's site */ public String getHostPassword() { return hostPassword; } /** Gets the address (URL) to login to the site's FTP account @return the address (URL) to login to the site's FTP account */ public String getFTPAddress() { return ftpAddress; } /** Gets the user name required to login to the site's FTP account @return the user name required to login to the FTP */ public String getFTPUserName() { return ftpUserName; } /** Gets the password required to login to the site's FTP account @return the password required to login to the FTP */ public String getFTPPassword() { return ftpPassword; } /** Gets all the information about the site and returns it in one formatted string for output @return the formatted string containing all information about the site */ public String toString() { String temp = ""; temp += "URL: " + address + "\n"; temp += "Company: " + company + "\n"; temp += "Topic: " + topic + "\n"; temp += "Designer: " + designer + "\n"; temp += "Start/Launch Date: " + startDate + "\n"; temp += "Webmaster Email: " + webmasterEmailAddress + "\n"; temp += "Hosted By: " + hostedBy + "\n"; temp += "Host URL: " + hostAddress + "\n"; temp += "Host User Name: " + hostUserName + "\n"; temp += "Host Password: " + hostPassword + "\n"; temp += "FTP URL: " + ftpAddress + "\n"; temp += "FTP User Name: " + ftpUserName + "\n"; temp += "FTP Password: " + ftpPassword + "\n"; return temp; } private String address, topic, company, designer, startDate, webmasterEmailAddress; private String hostedBy, hostAddress, hostUserName, hostPassword, ftpAddress, ftpUserName, ftpPassword; }