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();asReader()
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 IvyScript and Java. It has the visibility EXPERT.
-
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 IvyScript and Java. It has the visibility EXPERT.
-
asJavaFile
File asJavaFile()- Returns:
- java file that holds the content of the document
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-
asIvyFile
File asIvyFile()Example:
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 IvyScript and Java. It has the visibility NOVICE.
-
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 IvyScript and Java. It has the visibility NOVICE.
-
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 IvyScript and Java. It has the visibility EXPERT.
-
asBinary
Binary asBinary()Example:
Binary content = document.read().asBinary();
- Returns:
- binary with the content of the document
- API:
- This public API is available in IvyScript and Java. It has the visibility NOVICE.
-
asStream
InputStream asStream()- Returns:
- input stream that delivers the content of the document
- API:
- This public API is available in IvyScript and Java. It has the visibility EXPERT.
-