Copyright© 2008-2022 Sitevision AB, all rights reserved.
@Requireable(value="TemporaryFileNodeBuilder") public interface TemporaryFileNodeBuilder extends Builder<Node>
The sole purpose of a sv:temporaryFile is to represent a java.io.File as javax.jcr.Node
in order to support file-related operations in the API (e.g. FileUtil).
Important note! Temporary file nodes are very volatile and short-lived. They have no parent, nor any children. A temporary file node can never be looked up by its identifier and it should never be cached. Temporary file nodes should only be used for temporary purposes, typically during a single execution/render phase.
See Builder for a comprehensive example of how to work with builders.
An instance of the Sitevision class implementing this interface can be obtained via
NodeFactoryUtil.getTemporaryFileNodeBuilder().
See NodeFactoryUtil for how to obtain an instance of the NodeFactoryUtil interface.
| Modifier and Type | Method and Description |
|---|---|
Node |
build()
Creates a volatile and short-lived temporary file node using current state.
|
TemporaryFileNodeBuilder |
setFile(File aFile)
Sets the file.
|
TemporaryFileNodeBuilder |
setFileName(String aFileName)
Sets the name of the file.
|
TemporaryFileNodeBuilder setFileName(String aFileName)
The file name will also be used as the name of the Node that is built.
aFileName - the file nameTemporaryFileNodeBuilder setFile(File aFile)
aFile - the fileNode build() throws IllegalStateException
build in interface Builder<Node>IllegalStateException - if no file is set or no file name is setSitevision - Portal and Content Management Made Easy
Sitevision is an advanced Java enterprise portal product and a portlet container (JSR 286) that implements Java Content Repository (JSR 283).
Copyright© 2008-2022 Sitevision AB, all rights reserved.