Class FileUDTValue

    • Field Detail

      • fileName

        protected final String fileName
        The name of the file this UDT stems from.
    • Constructor Detail

      • FileUDTValue

        public FileUDTValue​(String userDefinedType,
                            FileUDTValue.FileDescriptor fileDescriptor)
                     throws IOException
        Creates a new FileUDTValue with 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 type
        fileDescriptor - The file descriptor representing a file containing the content for the UDTValue and the corresponding character set.
        Throws:
        IOException - If the designated file can not be read, an IOException will be thrown.
        IllegalArgumentException - If the designated file descriptor does not represent an existing file, an IllegalArgumentException will be thrown.
    • Method Detail

      • 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.
        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, an IOException will be thrown.
        IllegalArgumentException - If the designated file descriptor does not represent an existing file, an IllegalArgumentException will be thrown.
      • getContentStream

        public static InputStream getContentStream​(FileUDTValue.FileDescriptor fileDescriptor)
        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, an IllegalArgumentException will be thrown.