@@ -0,0 +1,1449 @@
+/*******************************************************************************%0A * Copyright (c) 2016 IBH SYSTEMS GmbH and others.%0A * All rights reserved. This program and the accompanying materials%0A * are made available under the terms of the Eclipse Public License v1.0%0A * which accompanies this distribution, and is available at%0A * http://www.eclipse.org/legal/epl-v10.html%0A *%0A * Contributors:%0A *     IBH SYSTEMS GmbH - initial API and implementation%0A *******************************************************************************/%0Apackage org.eclipse.packagedrone.utils.io;%0A%0Aimport java.io.BufferedOutputStream;%0Aimport java.io.IOException;%0Aimport java.io.OutputStream;%0Aimport java.nio.file.Files;%0Aimport java.nio.file.Path;%0A%0A/**%0A * A spool out target based on the local file system%0A */%0Apublic class FileSystemSpoolOutTarget implements SpoolOutTarget%0A%7B%0A    private final Path basePath;%0A%0A    public FileSystemSpoolOutTarget ( final Path basePath )%0A    %7B%0A        this.basePath = basePath;%0A    %7D%0A%0A    @Override%0A    public void spoolOut ( final String fileName, final String mimeType, final IOConsumer%3COutputStream%3E streamConsumer ) throws IOException%0A    %7B%0A        final Path path = this.basePath.resolve ( fileName );%0A        Files.createDirectories ( path.getParent () );%0A        try ( OutputStream stream = new BufferedOutputStream ( Files.newOutputStream ( path ) ) )%0A        %7B%0A            streamConsumer.accept ( stream );%0A        %7D%0A    %7D%0A%0A%7D%0A

add file system spoolout target