Module kala.compress.base
Package kala.compress.archivers
Class ArchiveReaderBuilder<R,B extends ArchiveReaderBuilder<R,B>>
- java.lang.Object
-
- kala.compress.archivers.ArchiveReaderBuilder<R,B>
-
- Direct Known Subclasses:
SevenZArchiveReader.Builder,ZipArchiveReader.Builder
public abstract class ArchiveReaderBuilder<R,B extends ArchiveReaderBuilder<R,B>> extends java.lang.Object- Since:
- 1.27.1-0
-
-
Field Summary
Fields Modifier and Type Field Description protected java.nio.charset.Charsetcharsetprivate static java.nio.charset.CharsetDEFAULT_CHARSETprotected static java.nio.file.OpenOption[]DEFAULT_OPEN_OPTIONSprotected java.nio.file.OpenOption[]openOptionsprotected java.lang.StringoriginDescriptionprotected java.nio.file.Pathpathprotected java.nio.channels.SeekableByteChannelseekableByteChannel
-
Constructor Summary
Constructors Constructor Description ArchiveReaderBuilder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected BasThis()Returns this instance typed as the proper subclass type.protected java.nio.file.PathcheckPath()abstract Rget()Gets the archive reader.BsetByteArray(byte[] origin)Sets a new origin.BsetCharset(java.lang.String charset)Sets the Charset.BsetCharset(java.nio.charset.Charset charset)Sets the Charset.BsetFile(java.io.File origin)Sets a new origin.BsetFile(java.lang.String origin)Sets a new origin.BsetOpenOptions(java.nio.file.OpenOption... openOptions)Sets the OpenOption[].BsetOriginDescription(java.lang.String description)Set the origin description.BsetPath(java.lang.String origin)Sets a new origin.BsetPath(java.nio.file.Path origin)Sets a new origin.BsetSeekableByteChannel(java.nio.channels.SeekableByteChannel origin)Sets a new origin.BsetURI(java.net.URI origin)Sets a new origin.
-
-
-
Field Detail
-
DEFAULT_CHARSET
private static final java.nio.charset.Charset DEFAULT_CHARSET
-
DEFAULT_OPEN_OPTIONS
protected static final java.nio.file.OpenOption[] DEFAULT_OPEN_OPTIONS
-
openOptions
protected java.nio.file.OpenOption[] openOptions
-
charset
protected java.nio.charset.Charset charset
-
originDescription
protected java.lang.String originDescription
-
seekableByteChannel
protected java.nio.channels.SeekableByteChannel seekableByteChannel
-
path
protected java.nio.file.Path path
-
-
Method Detail
-
checkPath
protected java.nio.file.Path checkPath()
-
setCharset
public final B setCharset(java.nio.charset.Charset charset)
Sets the Charset.- Parameters:
charset- the Charset, null resets to the default.- Returns:
thisinstance.
-
setCharset
public final B setCharset(java.lang.String charset)
Sets the Charset.- Parameters:
charset- the Charset, null resets to the default.- Returns:
thisinstance.
-
setOpenOptions
public final B setOpenOptions(java.nio.file.OpenOption... openOptions)
Sets the OpenOption[].- Parameters:
openOptions- the OpenOption[] name, null resets to the default.- Returns:
thisinstance.
-
setOriginDescription
public final B setOriginDescription(java.lang.String description)
Set the origin description.- Parameters:
description- the origin description, null resets to the default..- Returns:
thisinstance.
-
setSeekableByteChannel
public final B setSeekableByteChannel(java.nio.channels.SeekableByteChannel origin)
Sets a new origin.- Parameters:
origin- the new origin.- Returns:
thisinstance.
-
setByteArray
public final B setByteArray(byte[] origin)
Sets a new origin.- Parameters:
origin- the new origin.- Returns:
thisinstance.
-
setFile
public final B setFile(java.io.File origin)
Sets a new origin.- Parameters:
origin- the new origin.- Returns:
thisinstance.
-
setFile
public final B setFile(java.lang.String origin)
Sets a new origin.- Parameters:
origin- the new origin.- Returns:
thisinstance.
-
setPath
public final B setPath(java.nio.file.Path origin)
Sets a new origin.- Parameters:
origin- the new origin.- Returns:
thisinstance.
-
setPath
public final B setPath(java.lang.String origin)
Sets a new origin.- Parameters:
origin- the new origin.- Returns:
thisinstance.
-
setURI
public final B setURI(java.net.URI origin)
Sets a new origin.- Parameters:
origin- the new origin.- Returns:
thisinstance.
-
get
public abstract R get() throws java.io.IOException
Gets the archive reader.- Returns:
- a result.
- Throws:
java.io.IOException- if an I/O error occurs.
-
asThis
protected final B asThis()
Returns this instance typed as the proper subclass type.- Returns:
- this instance typed as the proper subclass type.
-
-