From 4435678fe7c1ca8f857dd008088b3d33ddec0484 Mon Sep 17 00:00:00 2001 From: Shireesh Anjal Date: Mon, 23 May 2011 12:38:11 +0530 Subject: Removing redundant sources --- .../storage/management/server/resources/Hello.java | 50 --------------- .../server/resources/ServerResource.java | 71 ---------------------- 2 files changed, 121 deletions(-) delete mode 100644 src/com.gluster.storage.management.server/src/com/gluster/storage/management/server/resources/Hello.java delete mode 100644 src/com.gluster.storage.management.server/src/com/gluster/storage/management/server/resources/ServerResource.java (limited to 'src/com.gluster.storage.management.server') diff --git a/src/com.gluster.storage.management.server/src/com/gluster/storage/management/server/resources/Hello.java b/src/com.gluster.storage.management.server/src/com/gluster/storage/management/server/resources/Hello.java deleted file mode 100644 index 4e379199..00000000 --- a/src/com.gluster.storage.management.server/src/com/gluster/storage/management/server/resources/Hello.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 Gluster, Inc. - * This file is part of Gluster Management Console. - * - * Gluster Management Console is free software; you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * Gluster Management Console is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License - * for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see - * . - *******************************************************************************/ -package com.gluster.storage.management.server.resources; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -//Sets the path to base URL + /hello -@Path("/hello") -public class Hello { - // This method is called if TEXT_PLAIN is request - @GET - @Produces(MediaType.TEXT_PLAIN) - public String sayPlainTextHello() { - return "Hello Jersey"; - } - - // This method is called if XMLis request - @GET - @Produces(MediaType.TEXT_XML) - public String sayXMLHello() { - return "" + " Hello Jersey" + ""; - } - - // This method is called if HTML is request - @GET - @Produces(MediaType.TEXT_HTML) - public String sayHtmlHello() { - return " " + "" + "Hello Jersey" + "" - + "

" + "Hello Jersey" + "

" + " "; - } -} diff --git a/src/com.gluster.storage.management.server/src/com/gluster/storage/management/server/resources/ServerResource.java b/src/com.gluster.storage.management.server/src/com/gluster/storage/management/server/resources/ServerResource.java deleted file mode 100644 index 08e8c9a6..00000000 --- a/src/com.gluster.storage.management.server/src/com/gluster/storage/management/server/resources/ServerResource.java +++ /dev/null @@ -1,71 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 Gluster, Inc. - * This file is part of Gluster Management Console. - * - * Gluster Management Console is free software; you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * Gluster Management Console is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License - * for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see - * . - *******************************************************************************/ -package com.gluster.storage.management.server.resources; - -import java.io.File; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -import com.gluster.storage.management.core.utils.FileUtil; -import com.gluster.storage.management.core.utils.ProcessResult; -import com.gluster.storage.management.core.utils.ProcessUtil; - -@Path("/server") -public class ServerResource { - // TODO: xml should be read from a "work" directory under the tomcat server. - // Use relative path - do not hard code the absolute path. - public static final String DISCOVERED_SERVERS_XML = "/GLUSTER/discovered-servers.xml"; - - /** - * Discover newly available servers - * - * @return list of discovered servers - */ - private String GetDiscoveredServers() { - File discoveredServersFile = new File(DISCOVERED_SERVERS_XML); - String serverNames = new FileUtil().readFileAsString(discoveredServersFile); - return serverNames; - } - - @Path("/discover") - @GET - @Produces(MediaType.TEXT_XML) - public String discoveredServers() { - return GetDiscoveredServers(); - } - - private String GetDetails() { - ProcessResult result = new ProcessUtil().executeCommand("get-server-details.py"); - if (!result.isSuccess()) { - //TODO:Generate error message and return - } - return result.getOutput(); - } - - @Path("/details") - @GET - @Produces(MediaType.TEXT_XML) - public String serverDetails() { - return GetDetails(); - } - -} -- cgit