saker.build Documentation TaskDoc JavaDoc Packages
@RMIWrap(ExecutionPathConfiguration.ConfigurationRMIWrapper.class)
public final class ExecutionPathConfiguration
Configuration class containing the path configurations for a build execution.

An instance of this class can be created via the provided builder.

The class contains the working directory of the execution and any file providers that are used for accessing the files. The file providers may be any SakerFileProvider implementations.

The class maps arbitrary root names to their respective file providers to access them through. The root names follow the rules specified in SakerPath.

Nested types
public static final class
Builder class for ExecutionPathConfiguration.
Methods
public static Builder
builder(SakerPath workingdirectory)
Creates a new configuration builder with the specified working directory.
public static Builder
builder(ExecutionPathConfiguration pathconfiguration, SakerPath workingdirectory)
Creates a new configuration builder that copies the file providers from the given configuration and uses the specified working directory.
public static ExecutionPathConfiguration
copy(ExecutionPathConfiguration copyconfig, SakerPath workingdirectory)
Creates a new configuration by copying an existing one and replacing the working directory.
public boolean
Indicates whether some other object is "equal to" this one.
public static ExecutionPathConfiguration
Creates a new path configuration that includes all roots from the specified file provider and uses the given working directory.
public SakerFileProvider
Gets the file provider which the path can be used for to access files.
public SakerFileProvider
Gets the file provider corresponding to the specified file provider key.
public SakerFileProvider
Gets the file provider which the path can be used for to access files if present.
public SakerFileProvider
Gets the file provider corresponding to the specified file provider key if present.
public ProviderHolderPathKey
Gets the path key for a path, resolving against the working directory if needed.
public SakerFileProvider
Gets the file provider for the specified root name.
public SakerFileProvider
Gets the file provider for the specified root name if present .
public NavigableMap<String, SakerFileProvider>
Gets the roots and corresponding file providers of this configuration.
public NavigableSet<String>
Gets the root names this configuration is configured for.
public SakerPath
Gets the working directory.
public ProviderHolderPathKey
Gets the path key for the working directory.
public boolean
Checks if this configuration contains a file provider for the given file provider key.
public boolean
hasRoot(String rootname)
Checks if this configuration has a file provider corresponding for the given root name.
public int
Returns a hash code value for the object.
public boolean
Checks if the root file providers in this configuration is the same as in the argument configuration.
public static ExecutionPathConfiguration
local(SakerPath workingdirectory)
Creates a path configuration that includes all roots from the local file provider and uses the specified working directory.
public SakerPath
Attempts to determine the corresponding execution path for the specified local file system path.
public SakerPath
Attempts to determine the corresponding execution path for the specified path key.
public Path
Attempts to determine the corresponding path on the local file system for the specified path.
public String
Returns a string representation of the object.
Inherited methods
From: Object
Creates a new configuration builder with the specified working directory.
workingdirectoryThe working directory to use for the configuration.
The builder.
InvalidPathFormatExceptionIf the working directory is not absolute.
NullPointerExceptionIf the argument is null.
public static Builder builder(ExecutionPathConfiguration pathconfiguration, SakerPath workingdirectory) throws InvalidPathFormatException, NullPointerException
Creates a new configuration builder that copies the file providers from the given configuration and uses the specified working directory.
pathconfigurationThe path configuration to copy.
workingdirectoryThe working directory to use for the configuration.
The builder.
InvalidPathFormatExceptionIf the working directory is not absolute.
NullPointerExceptionIf any of the argument is null.
Creates a new configuration by copying an existing one and replacing the working directory.
copyconfigThe configuration to copy.
workingdirectoryThe working directory to use for the new configuration.
The created configuration.
InvalidPathFormatExceptionIf the working directory is not absolute.
public boolean equals(Object obj)
Overridden from: Object
Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any non-null reference values x and y, this method returns true if and only if x and y refer to the same object (x == y has the value true).

Note that it is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.

objthe reference object with which to compare.
true if this object is the same as the obj argument; false otherwise.
Creates a new path configuration that includes all roots from the specified file provider and uses the given working directory.
workingdirectoryThe working directory to use.
fpThe file provider to include the roots from.
The created path configuration.
IOExceptionIn case of I/O error.
InvalidPathFormatExceptionIf the working directory is not absolute.
Gets the file provider which the path can be used for to access files.

This method requires the argument to be absolute, it won't be resolved against the working directory.

pathThe path.
The file provider for the path.
InvalidPathFormatExceptionIf the path is not absolute.
IllegalArgumentExceptionIf no file provider was found for the path.
Gets the file provider corresponding to the specified file provider key.

It is not required that the argument key is a root file provider key.

keyThe file provider key.
The file provider for the given key.
IllegalArgumentExceptionIf this configuration has no file provider for the key.
Gets the file provider which the path can be used for to access files if present.

This method requires the argument to be absolute, it won't be resolved against the working directory.

pathThe path.
The file provider for the path or null if not found in this configuration.
InvalidPathFormatExceptionIf the path is not absolute.
Gets the file provider corresponding to the specified file provider key if present.

It is not required that the argument key is a root file provider key.

keyThe file provider key.
The file provider for the given key or null if not found in this configuration.
Gets the path key for a path, resolving against the working directory if needed.
pathThe path.
The path key.
IllegalArgumentExceptionIf the configuration contains no root for the specified path.
Gets the file provider for the specified root name.

The root name is not validated if it has a valid format.

rootThe root name.
The file provider which was configured for the specified root.
IllegalArgumentExceptionIf no file provider was found for the root.
Gets the file provider for the specified root name if present .

The root name is not validated if it has a valid format.

rootThe root name.
The file provider or null if no file provider was configured for the specified root.
Gets the roots and corresponding file providers of this configuration.
An unmodifiable map of root file providers.
Gets the root names this configuration is configured for.
An unmodifiable set of root names used by this configuration.
Gets the working directory.
The absolute path to the working directory.
Gets the path key for the working directory.
The path key.
public boolean hasFileProvider(FileProviderKey key)
Checks if this configuration contains a file provider for the given file provider key.
keyThe file provider key.
true if this configuration has a file provider corresponding to the given key.
public boolean hasRoot(String rootname)
Checks if this configuration has a file provider corresponding for the given root name.

The root name is not validated if it has a valid format.

rootnameThe root name.
true if this configuration has a file provider for the root name.
public int hashCode()
Overridden from: Object
Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the Object.equals(Object) method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.

As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the Java™ programming language.)

a hash code value for this object.
Checks if the root file providers in this configuration is the same as in the argument configuration.
otherThe path configuration to compare the file providers with.
true if the root configurations are the same.
public static ExecutionPathConfiguration local(SakerPath workingdirectory) throws IOException
Creates a path configuration that includes all roots from the local file provider and uses the specified working directory.
workingdirectoryThe working directory to use.
The created path configuration.
IOExceptionIn case of I/O error.
Attempts to determine the corresponding execution path for the specified local file system path.

This method will try to uniquely identify the path used during execution for a specified local file system path.

This method returns non-null if and only if there exists a path configured by this configuration for accessing the specified argument. If the specified argument path cannot be accessed using file providers in this path configuration, null will be returned.

The argument path must be absolute.

The inverse operation is toLocalPath(SakerPath).

pathThe path.
The execution path which can be used to access the same path as the argument or null if there is no such path.
InvalidPathFormatExceptionIf the path is not absolute.
Attempts to determine the corresponding execution path for the specified path key.

This method will try to uniquely identify the path used during execution for a specified path key.

This method returns non-null if and only if there exists a path configured by this configuration for accessing the specified argument. If the specified argument path cannot be accessed using file providers in this path configuration, null will be returned.

The inverse operation is getPathKey(SakerPath).

pathThe path.
The execution path which can be used to access the same path as the argument or null if there is no such path.
InvalidPathFormatExceptionIf the path is not absolute.
Attempts to determine the corresponding path on the local file system for the specified path.

This method will try to uniquely identify the local file system path corresponding to the argument path.

This method determines the path key for the argument path, and checks if the file provider for it is the same as the local file system. If they equal, then a localized path will be returned for it.

The argument path must be absolute.

The inverse operation is toExecutionPath(Path).

pathThe path to localize.
The local path or null if the path doesn't denote a local path.
InvalidPathFormatExceptionIf the path is not absolute.
public String toString()
Overridden from: Object
Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 
a string representation of the object.