public class DataStoreImpl extends Object implements DataStore, DebianPackageConstants
A DataStore
implementation.
CONFFILES_ENTRY, CONFIG_ENTRY, CONTROL_ENTRY, CONTROL_NAME, CONTROL_TAR_PREFIX, DATA_NAME, DATA_TAR_PREFIX, DEBIAN_BINARY, DIRECTORY_MODE, DOC_BASE_PATH, FILE_MODE, MD5SUMS_ENTRY, POSTINST_ENTRY, POSTRM_ENTRY, PREINST_ENTRY, PRERM_ENTRY, ROOT_GROUP_ID, ROOT_GROUP_NAME, ROOT_USER_ID, ROOT_USER_NAME, SCRIPT_MODE, SHLIBS_ENTRY, SYMBOLS_ENTRY, TAR_BZIP2_SUFFIX, TAR_GZIP_SUFFIX, TAR_XZ_SUFFIX, TEMPLATES_ENTRY, TRIGGERS_ENTRY, USR_PATH, USR_SHARE_PATH
UTF_8, UTF_8_CHARSET
Constructor and Description |
---|
DataStoreImpl()
Creates a store.
|
Modifier and Type | Method and Description |
---|---|
void |
addDirectory(String path)
Adds a directory to the store.
|
void |
addDirectory(String path,
FileOwner owner,
FileMode mode)
Adds a directory to the store.
|
void |
addFile(DataSource source,
String path)
Adds a file to the store.
|
void |
addFile(DataSource source,
String path,
FileOwner owner,
FileMode mode)
Adds a file to the store.
|
void |
addSymLink(String path,
String target,
FileOwner owner,
FileMode mode)
Adds a symbolic link to the store.
|
List<FileHash> |
createFileHashes(MessageDigest digest)
Creates the hashes for all files in the store using the specified digest.
|
boolean |
exists(String path)
Returns the flag if a directory or file with the specified path exists.
|
Size |
getSize()
Returns the size of all files added to the store.
|
void |
write(org.apache.commons.compress.archivers.tar.TarArchiveOutputStream out)
Writes the directories and files added to the store into a TAR archive
using the specified stream.
|
public void addDirectory(String path)
DataStore
Adds a directory to the store.
This method is equal to the method
DataStore.addDirectory(String, FileOwner, FileMode)
using the following
values:
group ID | group name | user ID | user name | mode (octal) |
---|---|---|---|---|
0 | root | 0 | root | 0755 |
addDirectory
in interface DataStore
path
- The installation path.public void addDirectory(String path, FileOwner owner, FileMode mode)
DataStore
Adds a directory to the store.
addDirectory
in interface DataStore
path
- The installation path.owner
- The owner.mode
- The mode.public void addFile(DataSource source, String path)
DataStore
Adds a file to the store.
This method is equal to the method
DataStore.addFile(DataSource, String, FileOwner, FileMode)
using the
following values:
group ID | group name | user ID | user name | mode (octal) |
---|---|---|---|---|
0 | root | 0 | root | 0644 |
public void addFile(DataSource source, String path, FileOwner owner, FileMode mode)
DataStore
Adds a file to the store.
public void addSymLink(String path, String target, FileOwner owner, FileMode mode)
DataStore
Adds a symbolic link to the store.
addSymLink
in interface DataStore
path
- The installation path.target
- The target of the symbolic link.owner
- The owner.mode
- The mode.public boolean exists(String path)
DataStore
Returns the flag if a directory or file with the specified path exists.
public Size getSize() throws IOException
DataStore
Returns the size of all files added to the store.
getSize
in interface DataStore
IOException
- If an I/O error occurs.public void write(org.apache.commons.compress.archivers.tar.TarArchiveOutputStream out) throws IOException
DataStore
Writes the directories and files added to the store into a TAR archive using the specified stream.
write
in interface DataStore
out
- The stream on the TAR archive.IOException
- If an I/O error occurs.public List<FileHash> createFileHashes(MessageDigest digest) throws IOException
DataStore
Creates the hashes for all files in the store using the specified digest.
createFileHashes
in interface DataStore
digest
- The digest.IOException
- If an I/O error occurs.Copyright © 2015–2019. All rights reserved.