Class FileLoaderValueTranslator
java.lang.Object
de.hybris.platform.impex.jalo.translators.AbstractValueTranslator
de.hybris.platform.commerceservices.impex.impl.FileLoaderValueTranslator
Generic ValueTranslator that sets a string attribute. The value is loaded from a file. Supports loading files, jar
resources or zip file entries.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexportValue(Object value) Translates an attribute value for export usage.importData(String path) importValue(String valueExpr, Item toItem) Translates a tokenized csv value for import usage.protected booleanisAbsolutePath(String path) protected booleanisJarBasedPath(String path) protected booleanisZipBasedPath(String path) protected StringloadFromFile(String path) protected StringloadFromJarResource(String path) protected StringloadFromZipFile(String path) protected StringreadFromStream(Reader reader) Methods inherited from class de.hybris.platform.impex.jalo.translators.AbstractValueTranslator
clearStatus, createTranslator, createTranslator, createTranslator, debug, error, getColumnDescriptor, getFlexibleSearch, info, init, isDebugEnabled, isInfoEnabled, setEmpty, setError, validate, warn, wasEmpty, wasUnresolved
-
Constructor Details
-
FileLoaderValueTranslator
public FileLoaderValueTranslator()
-
-
Method Details
-
exportValue
Description copied from class:AbstractValueTranslatorTranslates an attribute value for export usage. This means the attribute value must be transformed into a string which should be re-importable again.- Specified by:
exportValuein classAbstractValueTranslator- Parameters:
value- value to translate- Returns:
- String translated value
- Throws:
JaloInvalidParameterException- value can not be translated with this translator or is invalid
-
importValue
Description copied from class:AbstractValueTranslatorTranslates a tokenized csv value for import usage. This means that the result object must be a instance of the expected attribute type.- Specified by:
importValuein classAbstractValueTranslator- Parameters:
valueExpr- expression to translatetoItem- the target item in case it already exist, null otherwise (for partOf attributes!)- Returns:
- Object translated value
- Throws:
JaloInvalidParameterException- value can not be translated with this translator or is invalid
-
importData
-
loadFromJarResource
-
loadFromFile
-
readFromStream
- Throws:
IOException
-
loadFromZipFile
-
isAbsolutePath
-
isJarBasedPath
-
isZipBasedPath
-