public interface DataStore
A store for managing the files in the data archive of a Debian package.
| 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.
|
void addDirectory(String path)
Adds a directory to the store.
This method is equal to the method
addDirectory(String, FileOwner, FileMode) using the following
values:
| group ID | group name | user ID | user name | mode (octal) |
|---|---|---|---|---|
| 0 | root | 0 | root | 0755 |
path - The installation path.IllegalArgumentException - If the installation path is null, the parent
directory wasn't added before or already contains an entry
with the same name. Only exception is the root "/"
directory which always exists.void addDirectory(String path, FileOwner owner, FileMode mode)
Adds a directory to the store.
path - The installation path.owner - The owner.mode - The mode.IllegalArgumentException - If any of the parameters are null, the path
doesn't contain an valid path, the parent directory wasn't
added before or already contains an entry with the same name.
Only exception is the root "/" directory which
always exists.void addFile(DataSource source, String path)
Adds a file to the store.
This method is equal to the method
addFile(DataSource, String, FileOwner, FileMode) using the
following values:
| group ID | group name | user ID | user name | mode (octal) |
|---|---|---|---|---|
| 0 | root | 0 | root | 0644 |
source - The source for the context of the file.path - The installation path.IllegalArgumentException - If any of the parameters are null, the parent
directory wasn't added before or already contains an entry
with the same name. Only exception is the root "/"
directory which always exists.void addFile(DataSource source, String path, FileOwner owner, FileMode mode)
Adds a file to the store.
source - The source for the content of the file.path - The installation path.owner - The owner.mode - The mode.IllegalArgumentException - If any of the parameters are null, the parent
directory wasn't added before or already contains an entry
with the same name. Only exception is the root "/"
directory which always exists.void addSymLink(String path, String target, FileOwner owner, FileMode mode)
Adds a symbolic link to the store.
path - The installation path.target - The target of the symbolic link.owner - The owner.mode - The mode.IllegalArgumentException - If any of the parameters are null, the parent
directory wasn't added before or already contains an entry
with the same name. Only exception is the root "/"
directory which always exists.boolean exists(String path)
Returns the flag if a directory or file with the specified path exists.
path - The path.true, if the path exists,
false otherwise.IllegalArgumentException - If the path is null.Size getSize() throws IOException
Returns the size of all files added to the store.
IOException - If an I/O error occurs.void write(org.apache.commons.compress.archivers.tar.TarArchiveOutputStream out)
throws IOException
Writes the directories and files added to the store into a TAR archive using the specified stream.
out - The stream on the TAR archive.IllegalArgumentException - If the stream is null.IOException - If an I/O error occurs.List<FileHash> createFileHashes(MessageDigest digest) throws IOException
Creates the hashes for all files in the store using the specified digest.
digest - The digest.IllegalArgumentException - If the digest is null.IOException - If an I/O error occurs.Copyright © 2015–2019. All rights reserved.