Ticket #362: Cleaned up a bit more.

This commit is contained in:
James Muehlner
2013-12-09 20:43:08 -08:00
parent d2aec9457f
commit 10e8fcabd2
4 changed files with 53 additions and 53 deletions

View File

@@ -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());

View File

@@ -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());