saker.build Documentation TaskDoc JavaDoc Packages
public interface ContentDatabase
A content database is responsible for storing expected contents of file system files.

It is used to synchronize the in-memory file hierarchy to the disk, and keep the content descriptors for the persisted files.

Internally a content database can store other meta-data related to the build executions.

Under normal circumstances, tasks should not directly interact with the content database.

Clients should not implement this interface.

Nested types
public interface
Represents a handle to the stored contents of a given path.
public static final class
Container for a ContentHandle and file attributes pair retrieved from a result of a file discovery.
public interface
Functional interface for executing content updating.
public interface
Synchronizer functional interface returned by the content database to execute content synchronization in a deferred manner.
Methods
public void
Creates the directories for the given path.
public void
Deletes the children of the directory specified by the path key if their name is not in the specified set.
public ContentHandle
Discovers a file at the given path and associates the provided contents with it.
public NavigableMap<String, ContentHandleAttributes>
Discovers the attributes of the children of the directory specified by the argument path key.
public ContentHandleAttributes
Discovers the attributes of the file at the given path key.
public ContentHandle
Discovers a file at the given path and associates the provided contents and posix file permissions with it.
public ByteArrayRegion
Gets the bytes of the specified file, optionally synchronizing first if the contents have changed.
public ContentDescriptor
Gets the content descriptor tracked by the database for the given path key.
public ContentHandle
Gets the content handle to the given path key.
public ExecutionPathConfiguration
Gets the path configuration this database uses.
public void
Invalidates the stored contents for a given path (and subpaths).
public ContentDescriptor
Invalidates the stored contents for a given path (and subpaths) and returns the contents after the invalidation for the path.
public ByteSource
Opens an input stream to the contents of the specified file, optionally synchronizing first if the contents have changed.
public void
Executes a synchronization for the given content descriptor using an updater.
public DeferredSynchronizer
Creates a deferred synchronizer for the specified path, if the contents have changed.
public void
Executes a directory synchronization at the given path.
public void
Writes the contents of the file specified by the argument path key, optionally synchronizing if the contents have changed.
public abstract void createDirectoryAtPath(ProviderHolderPathKey pathkey) throws IOException
Creates the directories for the given path.

Any parent files are overwritten with directories.

pathkeyThe path key.
IOExceptionIn case of I/O error.
Deletes the children of the directory specified by the path key if their name is not in the specified set.
pathkeyThe path key to the directory.
keepchildrenThe names of the children to keep.
IOExceptionIn case of I/O error.
Discovers a file at the given path and associates the provided contents with it.
pathkeyThe path key to discover.
contentThe contents to associate the discovered file with.
A content handle to the discovered file.
IOExceptionIn case of I/O error.
Discovers the attributes of the children of the directory specified by the argument path key.
directorypathkeyThe directory path key.
A map of child names to their discovered attribute handles.
IOExceptionIn case of I/O error.
Discovers the attributes of the file at the given path key.
pathkeyThe path key to the file.
A container for the discovered attributes and a content handle.
IOExceptionIn case of I/O error.
public abstract ContentHandle discoverWithPosixFilePermissions(ProviderHolderPathKey pathkey, @RMISerializeContentDescriptor content, @RMIWrap(saker.build.util.rmi.EnumSetRMIWrapper.class)Set<PosixFilePermission> permissions) throws IOException
Discovers a file at the given path and associates the provided contents and posix file permissions with it.
pathkeyThe path key to discover.
contentThe contents to associate the discovered file with.
permissionsThe posix file permissions to associate with the file. May be null.
A content handle to the discovered file.
IOExceptionIn case of I/O error.
saker.build 0.8.13
Gets the bytes of the specified file, optionally synchronizing first if the contents have changed.
pathkeyThe path key to the file.
contentThe expected content descriptor.
updaterThe synchronization executor.
The byte contents of the file.
IOExceptionIn case of I/O error.
Gets the content descriptor tracked by the database for the given path key.
pathkeyThe path key.
The content descriptor.
Gets the content handle to the given path key.
pathkeyThe path key.
The content handle.
Gets the path configuration this database uses.

This might be different from the path configuration of the current execution.

The path configuration.
public abstract void invalidate(PathKey pathkey)
Invalidates the stored contents for a given path (and subpaths).
pathkeyThe path key to invalidate.
Invalidates the stored contents for a given path (and subpaths) and returns the contents after the invalidation for the path.
pathkeyThe path key to invalidate.
The current content descriptor at the given path.
Opens an input stream to the contents of the specified file, optionally synchronizing first if the contents have changed.
pathkeyThe path key to the file.
contentThe expected content descriptor.
updaterThe synchronization executor.
An opened input stream to the contents of the file.
IOExceptionIn case of I/O error.
public abstract void synchronize(ProviderHolderPathKey pathkey, @RMISerializeContentDescriptor content, ContentUpdater updater) throws IOException
Executes a synchronization for the given content descriptor using an updater.

If the contents at the given path haven't changed, then the synchronization will be skipped.

pathkeyThe target path key to the synchronization.
contentThe content descriptor of the content to be synchronized to the path.
updaterThe updater to execute the synchronization.
IOExceptionIn case of I/O error.
Creates a deferred synchronizer for the specified path, if the contents have changed.
pathkeyThe path key to the to be synchronized file.
contentThe expected contents at the path.
updaterThe updater to execute the synchronization.
A deferred synchronizer, or null if the contents haven't changed.
public abstract void syncronizeDirectory(ProviderHolderPathKey pathkey, IORunnable dirsynchronizer) throws IOException
Executes a directory synchronization at the given path.
pathkeyThe path to the directory.
dirsynchronizerThe operation to execute for synchronization.
IOExceptionIn case of I/O error.
Writes the contents of the file specified by the argument path key, optionally synchronizing if the contents have changed.
pathkeyThe path key to the file.
contentThe expected content descriptor.
osThe output to write the contents to.
updaterThe synchronization executor.
IOExceptionIn case of I/O error-