Package dk.netarkivet.common.tools
Class FTPValidator
- java.lang.Object
-
- dk.netarkivet.common.tools.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
-
-
Field Summary
Fields Modifier and Type Field Description static String
SETTINGSFILEPATH
-
Constructor Summary
Constructors Constructor Description FTPValidator()
FTPValidator(String ftphost, int port, String user, String passwd)
Constructor for theFTPValidator
that takes the given arguments, and updates the FTP-settings accordingly.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
main(String[] args)
boolean
onServer(String nameOfUploadedFile)
boolean
test501MFile()
boolean
testConfigSettings()
Initially verify that communication with the ftp-server succeeds without using the RemoteFile.boolean
testDelete()
Check that the delete method can delete a file on the ftp serverboolean
testUploadAndRetrieve()
(1) Test, if uploaded and retrieved file are equal (2) test that rf.getSize() reports the correct value;boolean
testWrongChecksumThrowsError()
-
-
-
Field Detail
-
SETTINGSFILEPATH
public static final String SETTINGSFILEPATH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FTPValidator
public FTPValidator(String ftphost, int port, String user, String passwd) throws IOException
Constructor for theFTPValidator
that takes the given arguments, and updates the FTP-settings accordingly.- Parameters:
ftphost
- a given ftp-serverport
- a given ftp-port numberuser
- a given ftp userpasswd
- 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
-
testDelete
public boolean testDelete() throws FileNotFoundException
Check that the delete method can delete a file on the ftp server- Throws:
FileNotFoundException
-
testWrongChecksumThrowsError
public boolean testWrongChecksumThrowsError() throws Exception
- Throws:
Exception
-
onServer
public boolean onServer(String nameOfUploadedFile) throws IOException
- Throws:
IOException
-
-