mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-08 06:01:22 +00:00
Ticket #362: Cleaned up a bit more.
This commit is contained in:
@@ -97,7 +97,7 @@ public class ConnectionRESTService {
|
||||
}
|
||||
|
||||
if(parentConnectionGroup == null)
|
||||
throw new GuacamoleClientException("No ConnectionGroup found with the provided parentID.");
|
||||
throw new HTTPException(Status.NOT_FOUND, "No Connection found with the provided parentID.");
|
||||
|
||||
Directory<String, Connection> connectionDirectory =
|
||||
parentConnectionGroup.getConnectionDirectory();
|
||||
@@ -145,7 +145,7 @@ public class ConnectionRESTService {
|
||||
Connection connection = connectionDirectory.get(connectionID);
|
||||
|
||||
if(connection == null)
|
||||
throw new GuacamoleClientException("No Connection found with the provided ID.");
|
||||
throw new HTTPException(Status.NOT_FOUND, "No Connection found with the provided parentID.");
|
||||
|
||||
return new APIConnection(connection);
|
||||
} catch(GuacamoleSecurityException e) {
|
||||
@@ -178,7 +178,7 @@ public class ConnectionRESTService {
|
||||
|
||||
// Make sure the connection is there before trying to delete
|
||||
if(connectionDirectory.get(connectionID) == null)
|
||||
throw new GuacamoleClientException("No Connection found with the provided ID.");
|
||||
throw new HTTPException(Status.NOT_FOUND, "No Connection found with the provided ID.");
|
||||
|
||||
// Delete the connection
|
||||
connectionDirectory.remove(connectionID);
|
||||
@@ -225,7 +225,7 @@ public class ConnectionRESTService {
|
||||
}
|
||||
|
||||
if(parentConnectionGroup == null)
|
||||
throw new GuacamoleClientException("No ConnectionGroup found with the provided parentID.");
|
||||
throw new HTTPException(Status.NOT_FOUND, "No Connection found with the provided parentID.");
|
||||
|
||||
Directory<String, Connection> connectionDirectory =
|
||||
parentConnectionGroup.getConnectionDirectory();
|
||||
@@ -270,7 +270,7 @@ public class ConnectionRESTService {
|
||||
|
||||
// Make sure the connection is there before trying to update
|
||||
if(connectionDirectory.get(connectionID) == null)
|
||||
throw new GuacamoleClientException("No Connection with the provided ID.");
|
||||
throw new HTTPException(Status.NOT_FOUND, "No Connection found with the provided ID.");
|
||||
|
||||
// Update the connection
|
||||
connectionDirectory.update(new APIConnectionWrapper(connection));
|
||||
@@ -310,7 +310,7 @@ public class ConnectionRESTService {
|
||||
ConnectionGroup parentConnectionGroup = connectionGroupDirectory.get(parentID);
|
||||
|
||||
if(parentConnectionGroup == null)
|
||||
throw new GuacamoleClientException("No ConnectionGroup found with the provided parentID.");
|
||||
throw new HTTPException(Status.NOT_FOUND, "No Connection found with the provided parentID.");
|
||||
|
||||
// Move the connection
|
||||
connectionDirectory.move(connectionID, parentConnectionGroup.getConnectionDirectory());
|
||||
|
@@ -96,7 +96,7 @@ public class ConnectionGroupRESTService {
|
||||
}
|
||||
|
||||
if(parentConnectionGroup == null)
|
||||
throw new GuacamoleClientException("No ConnectionGroup found with the provided parentID.");
|
||||
throw new HTTPException(Status.NOT_FOUND, "No ConnectionGroup found with the provided parentID.");
|
||||
|
||||
Directory<String, ConnectionGroup> connectionGroupDirectory =
|
||||
parentConnectionGroup.getConnectionGroupDirectory();
|
||||
@@ -144,7 +144,7 @@ public class ConnectionGroupRESTService {
|
||||
ConnectionGroup connectionGroup = connectionGroupDirectory.get(connectionGroupID);
|
||||
|
||||
if(connectionGroup == null)
|
||||
throw new GuacamoleClientException("No ConnectionGroup found with the provided ID.");
|
||||
throw new HTTPException(Status.NOT_FOUND, "No ConnectionGroup found with the provided ID.");
|
||||
|
||||
return new APIConnectionGroup(connectionGroup);
|
||||
} catch(GuacamoleSecurityException e) {
|
||||
@@ -177,7 +177,7 @@ public class ConnectionGroupRESTService {
|
||||
|
||||
// Make sure the connection is there before trying to delete
|
||||
if(connectionGroupDirectory.get(connectionGroupID) == null)
|
||||
throw new GuacamoleClientException("No Connection found with the provided ID.");
|
||||
throw new HTTPException(Status.NOT_FOUND, "No ConnectionGroup found with the provided ID.");
|
||||
|
||||
// Delete the connection group
|
||||
connectionGroupDirectory.remove(connectionGroupID);
|
||||
@@ -224,7 +224,7 @@ public class ConnectionGroupRESTService {
|
||||
}
|
||||
|
||||
if(parentConnectionGroup == null)
|
||||
throw new GuacamoleClientException("No ConnectionGroup found with the provided parentID.");
|
||||
throw new HTTPException(Status.NOT_FOUND, "No ConnectionGroup found with the provided parentID.");
|
||||
|
||||
Directory<String, ConnectionGroup> connectionGroupDirectory =
|
||||
parentConnectionGroup.getConnectionGroupDirectory();
|
||||
@@ -269,7 +269,7 @@ public class ConnectionGroupRESTService {
|
||||
|
||||
// Make sure the connection group is there before trying to update
|
||||
if(connectionGroupDirectory.get(connectionGroupID) == null)
|
||||
throw new GuacamoleClientException("No ConnectionGroup with the provided ID.");
|
||||
throw new HTTPException(Status.NOT_FOUND, "No ConnectionGroup found with the provided ID.");
|
||||
|
||||
// Update the connection group
|
||||
connectionGroupDirectory.update(new APIConnectionGroupWrapper(connectionGroup));
|
||||
@@ -308,8 +308,8 @@ public class ConnectionGroupRESTService {
|
||||
Directory<String, ConnectionGroup> newConnectionGroupDirectory = rootGroup.getConnectionGroupDirectory();
|
||||
ConnectionGroup parentConnectionGroup = newConnectionGroupDirectory.get(parentID);
|
||||
|
||||
if(newConnectionGroupDirectory == null)
|
||||
throw new GuacamoleClientException("No ConnectionGroup found with the provided parentID.");
|
||||
if(parentConnectionGroup == null)
|
||||
throw new HTTPException(Status.NOT_FOUND, "No ConnectionGroup found with the provided parentID.");
|
||||
|
||||
// Move the connection
|
||||
connectionGroupDirectory.move(connectionGroupID, parentConnectionGroup.getConnectionGroupDirectory());
|
||||
|
Reference in New Issue
Block a user