Package com._1c.g5.v8.dt.export
Class OrdinaryDirectoryBuilder
- java.lang.Object
-
- com._1c.g5.v8.dt.export.OrdinaryDirectoryBuilder
-
- All Implemented Interfaces:
IExportArtifactBuilder
,Closeable
,AutoCloseable
public final class OrdinaryDirectoryBuilder extends Object implements IExportArtifactBuilder
An implementation ofIExportArtifactBuilder
that writes data to an ordinary directory.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
copy(Path sourcePath, Path targetPath)
Copies a file or directory residing on the local file system into the artifact.static OrdinaryDirectoryBuilder
create(Path directoryPath)
Creates a new builder.OutputStream
newOutputStream(Path path)
Creates an output stream for writing a file inside the artifact.
-
-
-
Method Detail
-
create
public static OrdinaryDirectoryBuilder create(Path directoryPath)
Creates a new builder.- Parameters:
directoryPath
- The path of the target directory. May not benull
.- Returns:
- a new ordinary directory builder. Never
null
.
-
newOutputStream
public OutputStream newOutputStream(Path path) throws IOException
Description copied from interface:IExportArtifactBuilder
Creates an output stream for writing a file inside the artifact. All nonexistent directories are created automatically. The returned stream does not need wrapping intoBufferedOutputStream
. If the given path already exists, the behavior of this method is not defined.- Specified by:
newOutputStream
in interfaceIExportArtifactBuilder
- Parameters:
path
- The path to the file inside the artifact. May not benull
.- Returns:
- a new output stream. Never
null
. - Throws:
IOException
- if any I/O error occurs.
-
copy
public void copy(Path sourcePath, Path targetPath) throws IOException
Description copied from interface:IExportArtifactBuilder
Copies a file or directory residing on the local file system into the artifact. All nonexistent directories are created automatically. If the given target path already exists, the behavior of this method is not defined.- Specified by:
copy
in interfaceIExportArtifactBuilder
- Parameters:
sourcePath
- The path of the source file or directory residing on the local file system. May not benull
.targetPath
- The path of the target file or directory inside the artifact. May not benull
.- Throws:
IOException
- if any I/O error occurs.
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-