@@ -0,0 +1,2490 @@
+package nl.hsac.fitnesse.fixture.slim;%0A%0Aimport java.io.File;%0Aimport java.io.FileInputStream;%0Aimport java.io.IOException;%0A%0Aimport nl.hsac.fitnesse.fixture.util.FileUtil;%0A%0Aimport org.apache.commons.io.FilenameUtils;%0Aimport org.apache.commons.io.IOUtils;%0A%0A/**%0A * Fixture to deal with Base64 values.%0A */%0Apublic class Base64Fixture extends SlimFixture %7B%0A    private String saveBase = new File(filesDir, %22base64%22).getPath() + %22/%22;%0A%0A    /**%0A     * Gets the content of specified file base64 encoded.%0A     * @param fileUrl either absolute path, or link to file inside wiki's files section.%0A     * @return base64 encoded file content.%0A     */%0A    public String encode(String fileUrl) %7B%0A        String file = getFilePathFromWikiUrl(fileUrl);%0A        try %7B%0A            byte%5B%5D content = IOUtils.toByteArray(new FileInputStream(file));%0A            return base64Encode(content);%0A        %7D catch (IOException e) %7B%0A            throw new SlimFixtureException(%22Unable to read: %22 + file, e);%0A        %7D%0A    %7D%0A%0A    /**%0A     * Creates a new file with content read from base64 encoded string.%0A     * @param fileName (base) file name to create (if a file with specified name already exists%0A     *                 a number will be added to make the name unique).%0A     * @param base64String base64 encoded string to decode and use as file content.%0A     * @return location of created file.%0A     */%0A    public String createFrom(String fileName, String base64String) %7B%0A        String result;%0A        String baseName = FilenameUtils.getBaseName(fileName);%0A        String target = saveBase + baseName;%0A        String ext = FilenameUtils.getExtension(fileName);%0A        byte%5B%5D content = base64Decode(base64String);%0A        String downloadedFile = FileUtil.saveToFile(target, ext, content);%0A        String wikiUrl = getWikiUrl(downloadedFile);%0A        if (wikiUrl != null) %7B%0A            // make href to file%0A            result = String.format(%22%3Ca href=%5C%22%25s%5C%22%3E%25s%3C/a%3E%22, wikiUrl, fileName);%0A        %7D else %7B%0A            result = downloadedFile;%0A        %7D%0A        return result;%0A    %7D%0A%0A    protected String base64Encode(byte%5B%5D content) %7B%0A        return org.apache.commons.codec.binary.Base64.encodeBase64String(content);%0A    %7D%0A    protected byte%5B%5D base64Decode(String base64String) %7B%0A        return org.apache.commons.codec.binary.Base64.decodeBase64(base64String);%0A    %7D%0A%0A    public String getSaveBase() %7B%0A        return saveBase;%0A    %7D%0A%0A    public void setSaveBase(String saveBase) %7B%0A        this.saveBase = saveBase;%0A    %7D%0A%7D%0A

Add fixture to deal with base64 encoded binary values