public class DSpaceCSV extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
protected static String |
authoritySeparator
The authority separator (defaults to double colon '::')
|
protected static String |
escapedAuthoritySeparator
The authority separator in an escaped form for using in regexes
|
protected static String |
escapedFieldSeparator
The field separator in an escaped form for using in regexes
|
protected static String |
escapedValueSeparator
The value separator in an escaped form for using in regexes
|
protected static String |
fieldSeparator
The field separator (defaults to comma)
|
protected static String |
valueSeparator
The value separator (defaults to double pipe '||')
|
| Constructor and Description |
|---|
DSpaceCSV(boolean exportAll)
Create a new instance of a CSV line holder
|
DSpaceCSV(File f,
Context c)
Create a new instance, reading the lines in from file
|
| Modifier and Type | Method and Description |
|---|---|
void |
addItem(Item i)
Add a DSpace item to the CSV file
|
void |
addItem(String line)
Add an item to the CSV file, from a CSV line of elements
|
List<DSpaceCSVLine> |
getCSVLines()
Get the lines in CSV holders
|
String[] |
getCSVLinesAsStringArray()
Get the CSV lines as an array of CSV formatted strings
|
List<String> |
getHeadings()
Get the headings used in this CSV file
|
boolean |
hasActions()
Decide if this CSV file has an 'action' (case-dependent!) header.
|
void |
save(String filename)
Save the CSV file to the given filename
|
String |
toString()
Return the csv file as one long formatted string
|
protected static String valueSeparator
protected static String escapedValueSeparator
protected static String fieldSeparator
protected static String escapedFieldSeparator
protected static String authoritySeparator
protected static String escapedAuthoritySeparator
public DSpaceCSV(boolean exportAll)
exportAll - Whether to export all metadata such as handles and provenance informationpublic boolean hasActions()
public final void addItem(Item i) throws Exception
i - The DSpace itemException - if something goes wrong with adding the Itempublic final void addItem(String line) throws Exception
line - The line of elementsException - Thrown if an error occurs when adding the itempublic final List<DSpaceCSVLine> getCSVLines()
public final String[] getCSVLinesAsStringArray()
public final void save(String filename) throws IOException
filename - The filename to save the CSV file toIOException - Thrown if an error occurs when writing the filepublic List<String> getHeadings()
Copyright © 2013 DuraSpace. All Rights Reserved.