Package ch.ivyteam.ivy.workflow.document
Interface IDocumentContentReader
public interface IDocumentContentReader
Provides methods to read the content of a document
.
Example:
String content = document.read().asIvyFile().read();
String content = document.read().useEncoding("UTF-8").asString();
- API:
- This is a public API.
-
Method Summary
Modifier and TypeMethodDescriptionasBinary()
Example:
Binary content = document.read().asBinary();
Example:
File file = document.read().asIvyFile();
String content = file.read();Attention: if you configure an external document storage, files won't be available on this file system as java fileasReader()
Get a reader that delivers the content of the document.asStream()
asString()
Get a string with the content of the document.useEncoding
(String encoding) Sets the encoding that will be used by the methodsasString()
andasReader()
to decode the content.useEncoding
(Charset encoding) Sets the encoding that will be used by the methodsasString()
andasReader()
to decode the content.
-
Method Details
-
useEncoding
Sets the encoding that will be used by the methodsasString()
andasReader()
to decode the content.- Parameters:
encoding
-- Returns:
- document content reader
- See Also:
- API:
- This public API is available in Java.
-
useEncoding
Sets the encoding that will be used by the methodsasString()
andasReader()
to decode the content.- Parameters:
encoding
-- Returns:
- document content reader
- API:
- This public API is available in Java.
-
asJavaFile
File asJavaFile()Attention: if you configure an external document storage, files won't be available on this file system as java file- Returns:
- java file that holds the content of the document
- API:
- This public API is available in Java.
-
asIvyFile
File asIvyFile()Example:
Attention: If you configure an external document storage, files won't be available on this file system as ivy file
File file = document.read().asIvyFile();
String content = file.read();- Returns:
- ivy file that holds the content of the document
- API:
- This public API is available in Java.
-
asString
String asString()Get a string with the content of the document. If an encoding is set it will be used to decode the content.Example:
String content = document.read().asString();
- Returns:
- content as string
- See Also:
- API:
- This public API is available in Java.
-
asReader
Reader asReader()Get a reader that delivers the content of the document. If an encoding is set it will be used to decode the content.- Returns:
- reader
- See Also:
- API:
- This public API is available in Java.
-
asBinary
Binary asBinary()Example:
Binary content = document.read().asBinary();
- Returns:
- binary with the content of the document
- API:
- This public API is available in Java.
-
asStream
InputStream asStream()- Returns:
- input stream that delivers the content of the document
- API:
- This public API is available in Java.
-