Class FileUDTValue.FileDescriptor
- java.lang.Object
-
- de.aristaflow.adept2.model.datamanagement.FileUDTValue.FileDescriptor
-
- All Implemented Interfaces:
Serializable
- Enclosing class:
- FileUDTValue
public static class FileUDTValue.FileDescriptor extends Object implements Serializable
Represents a file by its name as well as an optional charset which is used to decode the bytes read from the file.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FileDescriptor(String fileName, boolean charContent)
Creates a newFileDescriptor
for the designated file which may be other binary content or character content.FileDescriptor(String fileName, Charset charset)
Creates a newFileDescriptor
for the designated character file with the designated character set for decoding the read bytes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
fileValid()
Returns whether this descriptor represents a valid file, that is whether the file with the designated name really exists.Charset
getCharset()
Gets the character set to be used for decoding the bytes read from the file this descriptor represents.String
getFileName()
Gets the name of the file this descriptor represents.String
toString()
-
-
-
Constructor Detail
-
FileDescriptor
public FileDescriptor(String fileName, boolean charContent)
Creates a newFileDescriptor
for the designated file which may be other binary content or character content. If it is character content, UTF-8 will be used for decoding. If you need another decoding useFileDescriptor(String, Charset)
.- Parameters:
fileName
- The name of the file the created file descriptor represents.charContent
- Whether the content of the file is to be interpreted as characters with UTF-8 character set.
-
FileDescriptor
public FileDescriptor(String fileName, Charset charset)
Creates a newFileDescriptor
for the designated character file with the designated character set for decoding the read bytes.- Parameters:
fileName
- The name of the file the created file descriptor represents.charset
- The character set to be used for decoding the read bytes.
-
-
Method Detail
-
getFileName
public String getFileName()
Gets the name of the file this descriptor represents.- Returns:
- The name of the file this descriptor represents.
-
getCharset
public Charset getCharset()
Gets the character set to be used for decoding the bytes read from the file this descriptor represents. This will be null in case the file is not a character file.- Returns:
- The character set to be used for decoding the bytes read from the file this descriptor represents or null in case of a non-character file.
-
fileValid
public boolean fileValid()
Returns whether this descriptor represents a valid file, that is whether the file with the designated name really exists.- Returns:
- Whether this descriptor represents a valid file, that is whether the file with the designated name really exists.
-
-