Updater (Swing): focus the username and password fields

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add scijava-common as an explicit dependency of the ssh uploader

It was a transitive dependency already, but should be explicit because
classes from scijava-common are used directly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Updater: quite a few TODOs have been squashed a long time ago

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Fix compiler warnings in the updater

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Uploader: Strip updater type from the host

For example, when the host is specified as 'ssh:muahaha.cn', the host
really is 'muahaha.cn', not 'ssh:muahaha.cn'.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Updater (cmd-line): avoid static usage

The command-line updater was implemented mainly using static
methods. However, we should reuse it to test the updater in the unit
tests, to simplify the test code dramatically. Hence we need to use
an instance (to set the ImageJ root directory other than by an unsafe
global system property).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Updater (cmd-line): only call System.exit() when run stand-alone

As we want to reuse the CommandLine updater in the unit tests,
we cannot allow it to end the current process except when run as a
stand-alone main class.

We do this by teaching the die() method to exit only when the class
was called from the main() method.

To help the compiler detect unreachable code correctly, we do
not simply throw an exception in embedded mode, but return the
RuntimeException that has to be thrown by the caller.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Updater (cmd-line): add the 'remove-update-site' command

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Updater (cmd-line): upload errors should be fatal

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Updater (cmd-line): a password prompt is incompatible with batch mode

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Expose more attributes of the FilesUploader

This change is needed for the upcoming WebDAV uploader.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a WebDAV-based uploader for the ImageJ updater

The idea is to allow more contributors to offer their plugins and
extensions more easily.

To provide a WebDAV-based update site with Apache, make a directory
(preferably in the webspace) and add a file looking roughly like this to
Apache's conf.d/ directory:

	<Location /update>
		DAV on
		AuthType Basic
		AuthName "ImageJ update site"
		AuthUserFile /etc/apache2/webdav-uploaders.db
		Options +Indexes
		<LimitExcept HEAD OPTIONS GET>
			Require valid-user
		</LimitExcept>
	</Location>

Then, initialize the password file like this:

	sudo htpasswd -c /etc/apache2/webdav-uploaders.db rasband

Finally, make sure that the directory referenced in the <Location> tag
is read/writable by the Apache process (typically www-data), and restart
Apache gracefully:

	sudo chown -R www-data.www-data /var/www/update
	sudo apache2ctl graceful

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Make test-jars in all projects

This is a useful feature to be able to re-use test classes in dependencees.

Suggested by Curtis Rueden.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Refactor the updater test

The helper methods can now be reused in dependent projects.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Simplify UpdaterTestUtils class

No need for a 'German' method name, and no need to require a progress
instance, no need to carry around ijRoot and webRoot when a
FilesCollection carries both...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add an integration test for WebDAV

This test is skipped unless a test WebDAV web space is defined via the
webdav.test.url, webdav.test.username and webdav.test.password system
properties.

Any files within the specified directory are expected to be fair game
and could be deleted by this test.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Quench a bogus compiler warning

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Refactor a base class out of the WebDAV uploader test

The basic uploader tests all look the same, no need to encourage copy &
paste (& stale)...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Fix compiler warnings in ij-updater-ssh

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add an SSH upload integration test

Modeled after the WebDAV test, the SSH test is conditional, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>