public abstract class FileConnectorParams extends DataSetConnectorParams
DataSetConnectorParams
implementation used by file based
DataSetConnectors.Modifier and Type | Field and Description |
---|---|
static String |
ADJUST_DATA_TYPE_PROP
The adjust data type property.
|
static String |
ALL_STRINGS_PROP
The parse all fields as string property.
|
static String |
BASE64_ENCODE_CLOB_PROP
Encode CLOB fields using base64.
|
static String |
BOOLEAN_AS_NUMBER_PROP
Boolean as 1/0.
|
static String |
CONVERT_NULL_PROP
The convert 'null' to null property.
|
static String |
ENCODING_PROP
The encoding property.
|
static String |
NAME_TO_SQL_NAME_PROP
The convert column name to valid sql column name.
|
static String |
NULL_IF_EMPTY_PROP
The null if empty.
|
static String |
OVERRIDE_WILCARD_PROP
The override wildcard file names in
|
static String |
SPLIT_BY_PROP
The SPLIT BY property.
|
static String |
SUFFIX_PROP
The SUFFIX property.
|
static String |
TEMPALTE_PROP
The file template.
|
AUTO_COMMIT_PROP, FILE_NAME_PROP, MAX_ROWS_EXCEEDED_EXCEPTION, PASSWORD_PROP, PROPERTIES_PROP, TRANSPORT_PROP, USE_SELECTED_PROP, USER_ID_PROP
Constructor and Description |
---|
FileConnectorParams(CacheProvider<String,Object> cacheProvider,
boolean silent,
int logStep)
Instantiates a new FileConnectorParams.
|
Modifier and Type | Method and Description |
---|---|
Alias |
alias2alias(Alias source)
Creates an new Alias object using given source alias.
|
boolean |
deserializeToInputStream(IoProcessorCallable ioProcessorCallable,
String fileName,
Alias alias,
TypedKeyValue<String,String> fileNameToRead)
Deserialize data into inputstream.
|
Alias |
getAlias()
Gets the alias.
|
Object |
getCdata()
Gets the cdata.
|
String |
getDateFormat()
Gets the date format.
|
String |
getDateTimeFormat()
Gets the date time format.
|
String |
getEncoding()
Gets the char encoding.
|
String |
getFileName()
Gets the file name.
|
String |
getFileName(String name,
String ext,
boolean forceExt,
boolean reading,
String defaultName,
Integer... batchNumber)
Gets the file name.
|
TypedKeyValue<Boolean,String> |
getFileNameIfFileSystem(String fileName,
String ownerName,
Alias alias,
IoProcessor ioProcessor)
Gets the file name if IO processor is a file system.
|
String |
getFolder()
Gets the folder.
|
String |
getInitStr(String name,
Alias alias)
Gets the initialization string using given alias.
|
Alias |
getOriginalAlias()
Gets the original alias.
|
String |
getPassword()
Gets the password.
|
String |
getProperties()
Gets the properties.
|
String |
getRealFileName()
Gets the real file name.
|
String |
getSplitBy()
Gets the split by property.
|
String |
getSuffix()
Gets the suffix.
|
String |
getTemplate()
Gets the template.
|
String |
getTemplateToUse()
Gets the template to use.
|
String |
getTimeFormat()
Gets the time format.
|
String |
getTransport()
Gets the transport protocol such as file, ftp, sftp.
|
String |
getUserId()
Gets the user id.
|
String |
getWildcardUrl(String url,
String name)
Gets the url for wildcard file processing.
|
void |
init(Alias alis)
Initializes itself using given alias.
|
void |
init(Map<String,String> props)
Initializes itself using given properties.
|
boolean |
isAdjustDataTypes()
Checks if is adjust data types.
|
boolean |
isAllStrings()
Checks if all fields should have a string data type.
|
boolean |
isBooleanAsNumber()
If true convert true/false to 1/0.
|
boolean |
isConvertNameToSqlName()
Checks if field name should be converted to valid sql column name.
|
boolean |
isConvertNull()
Checks if is convert null.
|
boolean |
isCurrentStreaming()
Checks if is current streaming.
|
boolean |
isDateFormat(String format)
Checks if given format string is a date format.
|
boolean |
isDateTimeFormat(String format)
Checks if given format string is a date time format.
|
boolean |
isDisableStreaming()
Checks if streaming is disabled.
|
boolean |
isEncodeClob()
Checks if CLOB fields should be encoded using base64 algorithm.
|
boolean |
isFileNameRequired()
Checks if file name is required.
|
boolean |
isForceExt()
If true the file extension will be forced when reading and writing files
|
boolean |
isNoOriginalFileName()
Checks if "no original file name" flag is set.
|
boolean |
isNullIfEmpty()
If true and the value of the string is "" return null.
|
boolean |
isOverrideWildcrad()
Checks if override wildcard file name in the
|
boolean |
isParseDates()
Checks if system should parse dates.
|
boolean |
isTimeFormat(String format)
Checks if given format string is a time format.
|
boolean |
isTrimValue()
Checks if should should trim column value.
|
boolean |
needToEncode()
Checks if char values need to be encoded.
|
void |
selfDiscover(boolean read)
Self discover IO processor type.
|
void |
setAdjustDataTypes(boolean adjustDataTypes)
Sets the adjust data types.
|
void |
setAllStrings(boolean allStrings)
Sets the "all strings" which controls whether all fields should have a
string data type.
|
void |
setBooleanAsNumber(boolean booleanAsNumber)
Sets the value of the property "boolean as number".
|
void |
setCdata(Object value)
Sets the cdata.
|
void |
setConvertNameToSqlName(boolean convertNameToSqlName)
Sets the "convert name to sql name" flag.
|
void |
setConvertNull(boolean value)
Sets the convert null.
|
void |
setDateFormat(String value)
Sets the date format.
|
void |
setDateTimeFormat(String value)
Sets the date time format.
|
void |
setDisableStreaming(boolean disableStreaming)
Sets the disable streaming flag.
|
void |
setEncodeClob(boolean encodeClob)
Sets the flag which triggers encoding CLOB fiels using base64 algorithm.
|
void |
setEncoding(String value)
Sets the encoding.
|
void |
setFieldDataType(FieldDef field,
int sqlDataType,
String nativeDataType)
Sets the field data type.
|
void |
setFileName(String value)
Sets the file name.
|
void |
setFileNameRequired(boolean value)
Sets the "file name required" flag.
|
void |
setFolder(String value)
Sets the folder.
|
void |
setForceExt(boolean forceExt)
Sets the value of the flag forceExt.
|
void |
setNoOriginalFileName(boolean noOriginalFileName)
Sets the "no original file name" flag.
|
void |
setNullIfEmpty(boolean nullIfEmpty)
Sets the value of the property "null if empty".
|
void |
setOverrideWildcrad(boolean overrideWildcrad)
Sets the flag "override wildcard file name in the
|
void |
setParseDates(boolean value)
Sets the "parses dates" flag.
|
void |
setPassword(String value)
Sets the password.
|
void |
setProperties(String value)
Sets the properties.
|
void |
setRealFileName(String value)
Sets the real file name.
|
void |
setSplitBy(String value)
Sets the split by property.
|
void |
setSuffix(String suffix)
Sets the suffix.
|
void |
setTemplate(String template)
Sets the template.
|
void |
setTimeFormat(String value)
Sets the time format.
|
void |
setTransport(String value)
Sets the transport protocol.
|
void |
setTrimValue(boolean value)
Sets the "trim value" flag.
|
void |
setUserId(String value)
Sets the user id.
|
copy, getAddFieldValueCallback, getAddRecordCallback, getAfterCallback, getBeforeCallback, getCacheProvider, getCrudAction, getInputStream, getIoProcessor, getLogStep, getMaxRows, getOutputStream, getParams, getPropsHint, getPropsWizardResource, getReadTracker, getTarget, getTransactionMonitor, hasAddRecordCallback, init, isCleanUpPersistOccured, isCloseInput, isCloseOutput, isEnabled, isIgnoreEmpty, isIgnoreNoRecords, isMaxRowsExceededException, isPostPersistOccured, isPrePersistOccured, isReadOnlyMetadata, isSilent, isStreaming, prepareForPopulate, setAddFieldValueCallback, setAddRecordCallback, setAfterCallback, setBeforeCallback, setCacheProvider, setCleanUpPersistOccurred, setCloseInput, setCloseOutput, setCrudAction, setEnabled, setHasAddRecordCallback, setIgnoreEmpty, setIgnoreNoRecords, setInputStream, setIoProcessor, setLogStep, setMaxRows, setOutputStream, setPostPersistOccured, setPrePersistOccured, setReadOnlyMetadata, setReadTracker, setSilent, setTarget, setTransactionMonitor, setUseSelectedDataSet, useSelectedDataSet
public static final String SPLIT_BY_PROP
public static final String ENCODING_PROP
public static final String SUFFIX_PROP
public static final String CONVERT_NULL_PROP
public static final String NULL_IF_EMPTY_PROP
public static final String ALL_STRINGS_PROP
public static final String ADJUST_DATA_TYPE_PROP
public static final String NAME_TO_SQL_NAME_PROP
public static final String TEMPALTE_PROP
public static final String OVERRIDE_WILCARD_PROP
public static final String BASE64_ENCODE_CLOB_PROP
public static final String BOOLEAN_AS_NUMBER_PROP
public FileConnectorParams(CacheProvider<String,Object> cacheProvider, boolean silent, int logStep)
cacheProvider
- the cache providersilent
- the silent flaglogStep
- the log steppublic Alias alias2alias(Alias source) throws Exception
DataSetConnectorParams
alias2alias
in class DataSetConnectorParams
source
- the source aliasException
- in case of any errorpublic Alias getAlias()
public Object getCdata()
public String getDateFormat()
public String getDateTimeFormat()
public String getEncoding()
public String getFileName()
public String getWildcardUrl(String url, String name)
url
- the urlname
- the file namepublic TypedKeyValue<Boolean,String> getFileNameIfFileSystem(String fileName, String ownerName, Alias alias, IoProcessor ioProcessor) throws Exception
fileName
- the file nameownerName
- the owner namealias
- the aliasioProcessor
- the io processorException
- in case of any errorpublic boolean deserializeToInputStream(IoProcessorCallable ioProcessorCallable, String fileName, Alias alias, TypedKeyValue<String,String> fileNameToRead) throws Exception
ioProcessorCallable
- the call backfileName
- the file namealias
- the aliasfileNameToRead
- the file name to readException
- in case of any errorpublic String getFileName(String name, String ext, boolean forceExt, boolean reading, String defaultName, Integer... batchNumber) throws Exception
name
- the original file nameext
- the extensionforceExt
- if true the given extension will be usedreading
- if true the function is used to get file name for readingdefaultName
- the default namebatchNumber
- the batch numberException
- the exceptionpublic String getFolder()
public String getInitStr(String name, Alias alias)
DataSetConnectorParams
getInitStr
in class DataSetConnectorParams
name
- the namealias
- the aliaspublic String getPassword()
public String getProperties()
public String getRealFileName()
public String getSplitBy()
splitBy
as a
key.public String getSuffix()
public String getTimeFormat()
public String getTransport()
public String getUserId()
public Alias getOriginalAlias()
public void init(Alias alis)
DataSetConnectorParams
init
in class DataSetConnectorParams
alis
- the aliaspublic void init(Map<String,String> props)
DataSetConnectorParams
init
in class DataSetConnectorParams
props
- the propertiespublic boolean isConvertNull()
public boolean isDateFormat(String format)
format
- the formatpublic boolean isDateTimeFormat(String format)
format
- the formatpublic boolean isFileNameRequired()
public boolean isParseDates()
public boolean isTimeFormat(String format)
format
- the formatpublic boolean isTrimValue()
public boolean needToEncode()
public void selfDiscover(boolean read) throws Exception
read
- if true configure params for reading, otherwise for writingException
- the exceptionpublic void setCdata(Object value)
value
- the new cdatapublic void setConvertNull(boolean value)
value
- the new convert nullpublic void setDateFormat(String value)
value
- the new date formatpublic void setDateTimeFormat(String value)
value
- the new date time formatpublic void setEncoding(String value)
value
- the new HTML encodingpublic void setFileName(String value)
value
- the new file namepublic void setFileNameRequired(boolean value)
value
- the new value for the "file name required" flagpublic void setFolder(String value)
value
- the new folderpublic void setParseDates(boolean value)
value
- the new value for the "parse dates" flagpublic void setPassword(String value)
value
- the new passwordpublic void setProperties(String value)
value
- the new propertiespublic void setRealFileName(String value)
value
- the new real file namepublic void setSplitBy(String value)
splitBy
as a
key.value
- the new value of the split by propertypublic void setSuffix(String suffix)
suffix
- the suffix to setpublic void setTimeFormat(String value)
value
- the new time formatpublic void setTransport(String value)
value
- the new transport protocolpublic void setTrimValue(boolean value)
value
- the new value for the "trim value" flagpublic void setUserId(String value)
value
- the new user idpublic boolean isNoOriginalFileName()
public void setNoOriginalFileName(boolean noOriginalFileName)
noOriginalFileName
- the new value of the "no original file name" flag.public boolean isConvertNameToSqlName()
public void setConvertNameToSqlName(boolean convertNameToSqlName)
convertNameToSqlName
- booleanpublic boolean isOverrideWildcrad()
public void setOverrideWildcrad(boolean overrideWildcrad)
overrideWildcrad
- the new override wildcradpublic boolean isEncodeClob()
public void setEncodeClob(boolean encodeClob)
encodeClob
- booleanpublic boolean isDisableStreaming()
public boolean isCurrentStreaming()
public void setDisableStreaming(boolean disableStreaming)
disableStreaming
- the new value for disable streaming flagpublic String getTemplate()
public String getTemplateToUse()
public void setTemplate(String template)
template
- the new templatepublic boolean isAllStrings()
public void setAllStrings(boolean allStrings)
allStrings
- boolean. If true all fields should have a string data typepublic void setFieldDataType(FieldDef field, int sqlDataType, String nativeDataType)
field
- the fieldsqlDataType
- the sql data typenativeDataType
- the native data typepublic boolean isAdjustDataTypes()
public void setAdjustDataTypes(boolean adjustDataTypes)
adjustDataTypes
- the new adjust data typespublic boolean isForceExt()
public void setForceExt(boolean forceExt)
forceExt
- the new boolean value of the forceExt flagpublic boolean isBooleanAsNumber()
public void setBooleanAsNumber(boolean booleanAsNumber)
booleanAsNumber
- booleanpublic boolean isNullIfEmpty()
public void setNullIfEmpty(boolean nullIfEmpty)
nullIfEmpty
- booleanCopyright © 2010-2020 Toolsverse. All Rights Reserved.