-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup: feat: add multiple selection to CSV writer
Same approach as for XSL has been implemented for the CSV writer. In the wizard of selecting a feature type has been implemented the multi selection table and the same number of .csv files are exported as the selection. ING-3987
- Loading branch information
1 parent
2487be3
commit 5fdc62e
Showing
5 changed files
with
388 additions
and
99 deletions.
There are no files selected for viewing
77 changes: 77 additions & 0 deletions
77
....core/src/eu/esdihumboldt/hale/common/core/io/supplier/ByteArrayOutputStreamSupplier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* Copyright (c) 2023 wetransform GmbH | ||
* | ||
* All rights reserved. This program and the accompanying materials are made | ||
* available under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation, either version 3 of the License, | ||
* or (at your option) any later version. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this distribution. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* Contributors: | ||
* wetransform GmbH <http://www.wetransform.to> | ||
*/ | ||
|
||
package eu.esdihumboldt.hale.common.core.io.supplier; | ||
|
||
import java.io.ByteArrayInputStream; | ||
import java.io.ByteArrayOutputStream; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.io.OutputStream; | ||
import java.net.URI; | ||
|
||
/** | ||
* I/O supplier based on a {@link ByteArrayOutputStream} | ||
* | ||
* @author EmanuelaEpure | ||
*/ | ||
public class ByteArrayOutputStreamSupplier | ||
implements LocatableInputSupplier<InputStream>, LocatableOutputSupplier<OutputStream> { | ||
|
||
private final ByteArrayOutputStream byteArrayOutputStream; | ||
|
||
/** | ||
* Create a ByteArrayOutputStream I/O supplier. | ||
* | ||
* @param byteArrayOutputStream the byteArrayOutputStream | ||
* | ||
*/ | ||
public ByteArrayOutputStreamSupplier(ByteArrayOutputStream byteArrayOutputStream) { | ||
this.byteArrayOutputStream = byteArrayOutputStream; | ||
} | ||
|
||
/** | ||
* @see eu.esdihumboldt.util.io.InputSupplier#getInput() | ||
*/ | ||
@Override | ||
public InputStream getInput() throws IOException { | ||
return new ByteArrayInputStream(byteArrayOutputStream.toByteArray()); | ||
} | ||
|
||
/** | ||
* @see eu.esdihumboldt.hale.common.core.io.supplier.Locatable#getLocation() | ||
*/ | ||
@Override | ||
public URI getLocation() { | ||
return null; | ||
} | ||
|
||
/** | ||
* @see eu.esdihumboldt.util.io.OutputSupplier#getOutput() | ||
*/ | ||
@Override | ||
public OutputStream getOutput() throws IOException { | ||
return byteArrayOutputStream; | ||
} | ||
|
||
/** | ||
* @see eu.esdihumboldt.hale.common.core.io.supplier.LocatableInputSupplier#getUsedLocation() | ||
*/ | ||
@Override | ||
public URI getUsedLocation() { | ||
return null; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.