Class FileUDTValue
java.lang.Object
de.aristaflow.adept2.model.datamanagement.ADEPT2UDTValue
de.aristaflow.adept2.model.datamanagement.FileUDTValue
- All Implemented Interfaces:
UDTValue,TypedCloneable<ADEPT2UDTValue>,Closeable,Serializable,AutoCloseable,Cloneable
A
FileUDTValue extends a UDTValue by file
support. A file may be specified via a FileUDTValue.FileDescriptor of which the
content is read and stored in this UDTValue. Please note that
this is only used for input parameters since all file information is lost as
soon as the UDTValue is stored. This is intended since only the
value is relevant in a process context, not where it stems from.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a file by its name as well as an optional charset which is used to decode the bytes read from the file. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StringThe name of the file this UDT stems from.Fields inherited from class de.aristaflow.adept2.model.datamanagement.ADEPT2UDTValue
cleanup, data, userDefinedTypeName -
Constructor Summary
ConstructorsConstructorDescriptionFileUDTValue(String userDefinedType, FileUDTValue.FileDescriptor fileDescriptor) Creates a newFileUDTValuewith the designated user-defined type name and the input of the file represented by the designated file descriptor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic byte[]getContent(FileUDTValue.FileDescriptor fileDescriptor) Deprecated, for removal: This API element is subject to removal in a future version.static InputStreamgetContentStream(FileUDTValue.FileDescriptor fileDescriptor) Gets an input stream for reading the contents of the file represented by the designated file descriptor.inthashCode()toString()Methods inherited from class de.aristaflow.adept2.model.datamanagement.ADEPT2UDTValue
clone, clone, cloneUnchecked, close, getBytes, getInputStream, getSize, getUserDefinedType, getValueAsArray, getValueAsStreamMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface de.aristaflow.adept2.model.datamanagement.UDTValue
getContentString, getSize, isEmpty
-
Field Details
-
fileName
The name of the file this UDT stems from.
-
-
Constructor Details
-
FileUDTValue
public FileUDTValue(String userDefinedType, FileUDTValue.FileDescriptor fileDescriptor) throws IOException Creates a newFileUDTValuewith the designated user-defined type name and the input of the file represented by the designated file descriptor.- Parameters:
userDefinedType- The name of the user-defined type of the value. the name of the user defined typefileDescriptor- The file descriptor representing a file containing the content for theUDTValueand the corresponding character set.- Throws:
IOException- If the designated file can not be read, anIOExceptionwill be thrown.IllegalArgumentException- If the designated file descriptor does not represent an existing file, anIllegalArgumentExceptionwill be thrown.
-
-
Method Details
-
getContent
@Deprecated(since="15.0.0", forRemoval=true) public static byte[] getContent(FileUDTValue.FileDescriptor fileDescriptor) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.UsegetContentStream(FileDescriptor)instead.Reads the contents of the file represented by the designated file descriptor. In case of a character file the read bytes are decoded according to the character set of the file descriptor and stored as UTF-8. Additionally, line breaks are replaced by\n.- Parameters:
fileDescriptor- The file descriptor representing a file of which the content is to be read.- Returns:
- The content of the file specified by the designated file descriptor.
- Throws:
IOException- If the designated file can not be read, anIOExceptionwill be thrown.IllegalArgumentException- If the designated file descriptor does not represent an existing file, anIllegalArgumentExceptionwill be thrown.
-
getContentStream
Gets an input stream for reading the contents of the file represented by the designated file descriptor. In case of a character file, the line breaks will be replaced by\n. Additionally, the the input stream will decode according to the character set of the file descriptor and recode the characters as UTF-8 (unless they are already UTF-8-encoded).- Parameters:
fileDescriptor- The file descriptor representing a file of which the content is to be read.- Returns:
- The content of the file specified by the designated file descriptor.
- Throws:
IllegalArgumentException- If the designated file descriptor does not represent an existing file, anIllegalArgumentExceptionwill be thrown.
-
toString
- Overrides:
toStringin classADEPT2UDTValue
-
equals
- Overrides:
equalsin classADEPT2UDTValue
-
hashCode
public int hashCode()- Overrides:
hashCodein classADEPT2UDTValue
-
getContentStream(FileDescriptor)instead.