public String getCompressCommand(final Path workdir, final List<Path> files) {
        final StringBuilder archive = new StringBuilder();
        if(files.size() == 1) {
            archive.append(this.escape(files.get(0).getAbsolute()));
        }
        else {
            // Use default filename
            archive.append(this.escape(files.get(0).getParent().getAbsolute())).append(Path.DELIMITER).append("Archive");
        }
        final List<String> command = new ArrayList<>();
        for(Path path : files) {
            command.add(this.escape(PathRelativizer.relativize(workdir.getAbsolute(), path.getAbsolute())));
        }
        return MessageFormat.format(preferences.getProperty(String.format("archive.command.create.%s", this.getIdentifier())),
                archive.toString(), StringUtils.join(command, " "), this.escape(workdir.getAbsolute()));
    }
@Test
    public void testCommand() throws FactoryException {
        assertEquals("cd /a; zip -qr /a/b.zip b",
                Archive.ZIP.getCompressCommand(new Path("/a", EnumSet.of(Path.Type.directory)),
                        Collections.singletonList(new Path("/a/b", EnumSet.of(Path.Type.file)))));
        assertEquals("cd /a; zip -qr /a/b\\ c.zip b\\ c",
                Archive.ZIP.getCompressCommand(new Path("/a", EnumSet.of(Path.Type.directory)),
                        Collections.singletonList(new Path("/a/b c", EnumSet.of(Path.Type.file)))));
        assertEquals("cd /a; tar -cpPf /a/b.tar b",
                Archive.TAR.getCompressCommand(new Path("/a", EnumSet.of(Path.Type.directory)),
                        Collections.singletonList(new Path("/a/b", EnumSet.of(Path.Type.file)))));
    }