public class ServerFile extends NamedObject
For importing data a file is first uploaded then its associated import is run. When exporting data an export process is run, then the resulting server file is downloaded
Modifier and Type | Class and Description |
---|---|
static class |
ServerFile.Format
File formats recognised by Ananplan import.
|
Modifier and Type | Method and Description |
---|---|
void |
downLoad(java.io.File target,
boolean deleteExisting)
Download a file from the server, writing it to the specified target file.
|
java.lang.String |
getCountry()
Get the country of the locale used for file autodetection.
|
java.lang.String |
getDelimiter()
Get the delimiter character used to enclose column cell data.
|
CellReader |
getDownloadCellReader()
Create a
CellReader implementation which will
download the content from the server. |
java.io.InputStream |
getDownloadStream()
Create an InputStream implementation which will download the content from
the server.
|
java.lang.String |
getEncoding()
Get the character encoding used for the file.
|
java.lang.Integer |
getFirstDataRow()
Get the row number of the first data row.
|
ServerFile.Format |
getFormat()
Get the format of the file.
|
java.lang.Integer |
getHeaderRow()
Get the row number of the header row.
|
java.lang.String |
getLanguage()
Get the language of the locale used for file autodetection.
|
java.lang.String |
getSeparator()
Get the separator character(s) used to separate columns.
|
CellWriter |
getUploadCellWriter()
Return a
CellWriter implementation which will
upload written content to the server, writing it to the specified target
file. |
java.io.OutputStream |
getUploadStream()
Return a new OutputStream implementation which will upload written
content to the server, writing it to the specified target file.
|
void |
setCountry(java.lang.String country)
Set the country of the locale used for file autodetection.
|
void |
setDelimiter(java.lang.String delimiter)
Set the delimiter character used to enclose column cell data.
|
void |
setEncoding(java.lang.String encoding)
Set the character encoding used for the file.
|
void |
setFirstDataRow(java.lang.Integer firstDataRow)
Set the row number of the first data row.
|
void |
setFormat(ServerFile.Format format)
Set the format of the file.
|
void |
setHeaderRow(java.lang.Integer headerRow)
Set the row number of the header row.
|
void |
setLanguage(java.lang.String language)
Set the language of the locale used for file autodetection.
|
void |
setSeparator(java.lang.String separator)
Set the separator character(s) used to separate columns.
|
void |
upLoad(java.io.File source,
boolean deleteExisting)
Upload a file to the server, writing it to the specified target file.
|
getCode, getId, getName
public void downLoad(java.io.File target, boolean deleteExisting) throws AnaplanAPIException, java.io.IOException
target
- The target file to write todeleteExisting
- If true, the target file will automatically be deleted if it
already exists; otherwise an Exception will be thrownAnaplanAPIException
java.io.IOException
public java.io.InputStream getDownloadStream() throws AnaplanAPIException, java.io.IOException
AnaplanAPIException
java.io.IOException
public CellReader getDownloadCellReader() throws AnaplanAPIException, java.io.IOException
CellReader
implementation which will
download the content from the server. The content is assumed to be in the
same format as written to by getUploadCellWriter.CellReader
which will read the
content stored on the serverAnaplanAPIException
java.io.IOException
public void upLoad(java.io.File source, boolean deleteExisting) throws AnaplanAPIException, java.io.IOException
source
- The source file to uploaddeleteExisting
- If true, the target server file will automatically be deleted
if it already exists; otherwise a FileException will be thrownAnaplanAPIException
java.io.IOException
public java.io.OutputStream getUploadStream() throws AnaplanAPIException, java.io.IOException
AnaplanAPIException
java.io.IOException
public CellWriter getUploadCellWriter() throws AnaplanAPIException
CellWriter
implementation which will
upload written content to the server, writing it to the specified target
file. The file will have the following format:
CellWriter
implementationAnaplanAPIException
public void setFormat(ServerFile.Format format)
format
- the file formatpublic ServerFile.Format getFormat()
public void setLanguage(java.lang.String language)
language
- The two-letter ISO-639 code of the language.public void setCountry(java.lang.String country)
country
- The two-letter ISO-3166 code of the country.public void setEncoding(java.lang.String encoding)
encoding
- The preferred MIME name of the encoding, or null. See http://www.iana.org/assignments/character-sets for a
complete list.public void setSeparator(java.lang.String separator)
separator
- A string containing 1+ separator characters, or null.public void setDelimiter(java.lang.String delimiter)
delimiter
- A string containing a single delimiter character, the empty
string, or null.public void setHeaderRow(java.lang.Integer headerRow)
headerRow
- Row number beginning at 1, zero if no header row present, or
null.public void setFirstDataRow(java.lang.Integer firstDataRow)
firstDataRow
- Row number beginning at 1, or null.public java.lang.String getLanguage()
public java.lang.String getCountry()
public java.lang.String getEncoding()
public java.lang.String getSeparator()
public java.lang.String getDelimiter()
public java.lang.Integer getHeaderRow()
public java.lang.Integer getFirstDataRow()