net.augeas
public class Augeas extends Object
| Field Summary | |
|---|---|
| protected Aug | AugLib
The augeas library handle |
| protected AugPointer | aug
Pointert to he active augeas instance. |
| protected int | lastReturn
The result of the last augeas call. |
| static int | NONE
Flags to use |
| static int | NO_LOAD
Do not load the tree from AUG_INIT |
| static int | NO_MODL_AUTOLOAD |
| static int | NO_STDINC
Do not use the builtin load path for modules |
| protected boolean | raiseExceptions
If a invalid augeas call (lastReturn = -1) should result in an exception |
| static int | SAVE_BACKUP
Keep the original file with a .augsave extension |
| static int | SAVE_NEWFILE
Save changes into a file with extension .augnew, and do not overwrite the
original file. |
| static int | SAVE_NOOP
Make save a no-op process, just record what would have changed |
| static int | TYPE_CHECK
Typecheck lenses; since it can be very expensive it is not done by
default |
| Constructor Summary | |
|---|---|
| Augeas()
Default constructor that defaults to root and no load path | |
| Augeas(int flags)
New Augeas instance with only the flags.
| |
| Augeas(String root, String loadpath, int flags)
Constructs a new Augeas connection
| |
| Method Summary | |
|---|---|
| protected void | check() |
| int | clear(String path)
Clear the PATH, i.e. set the value to null
|
| int | clearTransforms()
Clear all transforms under /augeas/load. |
| int | close()
Write all pending changes to disk
|
| int | defineNode(String name, String expr, String value)
Define a variable NAME whose value is the result of evaluating EXPR,
which must be non-NULL and evaluate to a nodeset.
|
| int | defineVariable(String name, String expr)
Define a variable NAME whose value is the result of evaluating EXPR.
|
| boolean | exists(String path)
Returns true if the path exists
|
| String | get(String path)
Lookup the value associated eith PATH
|
| int | getLastReturn()
Return the result from the last augeas call.
|
| boolean | getRaiseExceptions()
if exceptions should be raised |
| int | insert(String path, String label, boolean before)
Create a new sibling LABEL for PATH by inserting into the tree just
before PATH if BEFORE == 1 or just after PATH if BEFORE == 0.
|
| AugeasErrorCode | lastError()
Returns the error code from the last method call |
| String | lastErrorDetails()
Returns the error details from the last method call |
| String | lastErrorMessage()
Returns the error message from the last method call |
| String | lastMinorErrorMessage()
Returns the minor error message from the last method call |
| int | load()
Load files into the tree
|
| List<String> | match(String path)
Return a list of the nodes which match the path string
|
| int | move(String source, String dest)
Move the node SRC to DST.
|
| protected void | processLastCall(String message)
If the user has opted to throw exceptions on failure, this method will do
so based on a return code of -1 |
| int | remove(String path) |
| int | rm(String path)
Remove path and all its children.
|
| int | save()
Write all pending changes to disk
|
| int | set(String path, String value)
Set the value associated with PATH to VALUE.
|
| int | setMany(String base, String sub, String value)
Set the value of multiple nodes in one operation. |
| void | setRaiseExceptions(boolean value)
sets if exceptions should be raised |
| int | transform(String lens, String name, List<String> incl, List<String> excl)
Add a transform under /augeas/load
|
Parameters: flags
Parameters: root or all file lookups loadpath path for finding new schemas flags any flags to use
Returns: 0 / -1 based on success/fail
Returns: 0 / -1 based on success/fail
Returns: -1 on error, 0 on success
Returns: -1 on error; on success, returns the number of nodes in the nodeset
Returns: -1 on error; on success, returns 0 if EXPR evaluates to anything other than a nodeset, and the number of nodes if EXPR evaluates to a nodeset
Returns: true if it exists
Returns: the value
Returns:
Returns: 0 on success, and -1 if the insertion fails.
Returns: -1 on error, 0 on success
Parameters: path
Returns:
Returns: 0 on success and -1 on failure
See Also: rm
Returns: -1 / 0 based on fail/success
Returns: -1 on error, 0 on success
Returns: 0 on success, -1 on error. It is an error if more than one node matches PATH.
Returns: number of modified nodes on success, -1 on error
Parameters: lens the lens to use name a unique name (optional) incl a list of glob patterns to transform excl a list of glob patterns to remove
Returns: