summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/lookup/AgentPath.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/c2kernel/lookup/AgentPath.java')
-rw-r--r--src/main/java/com/c2kernel/lookup/AgentPath.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main/java/com/c2kernel/lookup/AgentPath.java b/src/main/java/com/c2kernel/lookup/AgentPath.java
index fb4ce0e..f6d6ca4 100644
--- a/src/main/java/com/c2kernel/lookup/AgentPath.java
+++ b/src/main/java/com/c2kernel/lookup/AgentPath.java
@@ -33,7 +33,7 @@ public class AgentPath extends ItemPath
private String mAgentName=null;
private String mPassword=null;
- public AgentPath(SystemKey syskey) throws InvalidAgentPathException {
+ public AgentPath(SystemKey syskey) throws InvalidAgentPathException, InvalidItemPathException {
super(syskey);
try {
findAgentName();
@@ -41,7 +41,7 @@ public class AgentPath extends ItemPath
throw new InvalidAgentPathException();
}
}
- public AgentPath(UUID uuid) throws InvalidAgentPathException {
+ protected AgentPath(UUID uuid) throws InvalidAgentPathException, InvalidItemPathException {
super(uuid);
try {
findAgentName();
@@ -132,6 +132,14 @@ public class AgentPath extends ItemPath
digest.append(Base64.encode(hash));
return digest.toString();
}
+
+ public static AgentPath fromUUIDString(String uuid) throws InvalidAgentPathException {
+ try {
+ return new AgentPath(ItemPath.fromUUIDString(uuid));
+ } catch (InvalidItemPathException ex) {
+ throw new InvalidAgentPathException(ex.getMessage());
+ }
+ }
}