Class FTPValidator


  • public class FTPValidator
    extends Object
    Tool for testing if a FTP server is NetarchiveSuite compliant. Usage: export OPTs=-Ddk.netarkivet.settings.file=$INSTALLDIR/conf/settings_GUIApplication.xml java $OPTS FTPValidator java FTPValidator /full/path/to/settings.xml java FTPValidator ftpHost ftpPort ftpUser ftpPasswd
    • Constructor Detail

      • FTPValidator

        public FTPValidator​(String ftphost,
                            int port,
                            String user,
                            String passwd)
                     throws IOException
        Constructor for the FTPValidator that takes the given arguments, and updates the FTP-settings accordingly.
        Parameters:
        ftphost - a given ftp-server
        port - a given ftp-port number
        user - a given ftp user
        passwd - a given ftp password
        Throws:
        Exception - if not able to reset the temporary directory used by the tool.
        IOException
      • FTPValidator

        public FTPValidator()
    • Method Detail

      • testConfigSettings

        public boolean testConfigSettings()
                                   throws IOException
        Initially verify that communication with the ftp-server succeeds without using the RemoteFile. (1) Verify, that you can upload a file to a ftp-server, and retrieve the same file from this server-server. (2) Verify, that file was not corrupted in transit
        Throws:
        IOException
      • testUploadAndRetrieve

        public boolean testUploadAndRetrieve()
                                      throws IOException
        (1) Test, if uploaded and retrieved file are equal (2) test that rf.getSize() reports the correct value;
        Throws:
        IOException
      • testWrongChecksumThrowsError

        public boolean testWrongChecksumThrowsError()
                                             throws Exception
        Throws:
        Exception