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)
|
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 =
|
Directory<String, Connection> connectionDirectory =
|
||||||
parentConnectionGroup.getConnectionDirectory();
|
parentConnectionGroup.getConnectionDirectory();
|
||||||
@@ -145,7 +145,7 @@ public class ConnectionRESTService {
|
|||||||
Connection connection = connectionDirectory.get(connectionID);
|
Connection connection = connectionDirectory.get(connectionID);
|
||||||
|
|
||||||
if(connection == null)
|
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);
|
return new APIConnection(connection);
|
||||||
} catch(GuacamoleSecurityException e) {
|
} catch(GuacamoleSecurityException e) {
|
||||||
@@ -178,7 +178,7 @@ public class ConnectionRESTService {
|
|||||||
|
|
||||||
// Make sure the connection is there before trying to delete
|
// Make sure the connection is there before trying to delete
|
||||||
if(connectionDirectory.get(connectionID) == null)
|
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
|
// Delete the connection
|
||||||
connectionDirectory.remove(connectionID);
|
connectionDirectory.remove(connectionID);
|
||||||
@@ -225,7 +225,7 @@ public class ConnectionRESTService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(parentConnectionGroup == null)
|
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 =
|
Directory<String, Connection> connectionDirectory =
|
||||||
parentConnectionGroup.getConnectionDirectory();
|
parentConnectionGroup.getConnectionDirectory();
|
||||||
@@ -270,7 +270,7 @@ public class ConnectionRESTService {
|
|||||||
|
|
||||||
// Make sure the connection is there before trying to update
|
// Make sure the connection is there before trying to update
|
||||||
if(connectionDirectory.get(connectionID) == null)
|
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
|
// Update the connection
|
||||||
connectionDirectory.update(new APIConnectionWrapper(connection));
|
connectionDirectory.update(new APIConnectionWrapper(connection));
|
||||||
@@ -310,7 +310,7 @@ public class ConnectionRESTService {
|
|||||||
ConnectionGroup parentConnectionGroup = connectionGroupDirectory.get(parentID);
|
ConnectionGroup parentConnectionGroup = connectionGroupDirectory.get(parentID);
|
||||||
|
|
||||||
if(parentConnectionGroup == null)
|
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
|
// Move the connection
|
||||||
connectionDirectory.move(connectionID, parentConnectionGroup.getConnectionDirectory());
|
connectionDirectory.move(connectionID, parentConnectionGroup.getConnectionDirectory());
|
||||||
|
@@ -96,7 +96,7 @@ public class ConnectionGroupRESTService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(parentConnectionGroup == null)
|
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 =
|
Directory<String, ConnectionGroup> connectionGroupDirectory =
|
||||||
parentConnectionGroup.getConnectionGroupDirectory();
|
parentConnectionGroup.getConnectionGroupDirectory();
|
||||||
@@ -144,7 +144,7 @@ public class ConnectionGroupRESTService {
|
|||||||
ConnectionGroup connectionGroup = connectionGroupDirectory.get(connectionGroupID);
|
ConnectionGroup connectionGroup = connectionGroupDirectory.get(connectionGroupID);
|
||||||
|
|
||||||
if(connectionGroup == null)
|
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);
|
return new APIConnectionGroup(connectionGroup);
|
||||||
} catch(GuacamoleSecurityException e) {
|
} catch(GuacamoleSecurityException e) {
|
||||||
@@ -177,7 +177,7 @@ public class ConnectionGroupRESTService {
|
|||||||
|
|
||||||
// Make sure the connection is there before trying to delete
|
// Make sure the connection is there before trying to delete
|
||||||
if(connectionGroupDirectory.get(connectionGroupID) == null)
|
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
|
// Delete the connection group
|
||||||
connectionGroupDirectory.remove(connectionGroupID);
|
connectionGroupDirectory.remove(connectionGroupID);
|
||||||
@@ -224,7 +224,7 @@ public class ConnectionGroupRESTService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(parentConnectionGroup == null)
|
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 =
|
Directory<String, ConnectionGroup> connectionGroupDirectory =
|
||||||
parentConnectionGroup.getConnectionGroupDirectory();
|
parentConnectionGroup.getConnectionGroupDirectory();
|
||||||
@@ -269,7 +269,7 @@ public class ConnectionGroupRESTService {
|
|||||||
|
|
||||||
// Make sure the connection group is there before trying to update
|
// Make sure the connection group is there before trying to update
|
||||||
if(connectionGroupDirectory.get(connectionGroupID) == null)
|
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
|
// Update the connection group
|
||||||
connectionGroupDirectory.update(new APIConnectionGroupWrapper(connectionGroup));
|
connectionGroupDirectory.update(new APIConnectionGroupWrapper(connectionGroup));
|
||||||
@@ -308,8 +308,8 @@ public class ConnectionGroupRESTService {
|
|||||||
Directory<String, ConnectionGroup> newConnectionGroupDirectory = rootGroup.getConnectionGroupDirectory();
|
Directory<String, ConnectionGroup> newConnectionGroupDirectory = rootGroup.getConnectionGroupDirectory();
|
||||||
ConnectionGroup parentConnectionGroup = newConnectionGroupDirectory.get(parentID);
|
ConnectionGroup parentConnectionGroup = newConnectionGroupDirectory.get(parentID);
|
||||||
|
|
||||||
if(newConnectionGroupDirectory == null)
|
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.");
|
||||||
|
|
||||||
// Move the connection
|
// Move the connection
|
||||||
connectionGroupDirectory.move(connectionGroupID, parentConnectionGroup.getConnectionGroupDirectory());
|
connectionGroupDirectory.move(connectionGroupID, parentConnectionGroup.getConnectionGroupDirectory());
|
||||||
|
Reference in New Issue
Block a user