karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anierb...@apache.org
Subject svn commit: r1099964 - in /karaf/trunk: shell/http/ shell/http/src/main/java/org/apache/karaf/shell/http/ shell/web/ shell/web/src/main/java/org/apache/karaf/shell/web/ util/src/main/java/org/apache/karaf/util/
Date Thu, 05 May 2011 20:47:09 GMT
Author: anierbeck
Date: Thu May  5 20:47:08 2011
New Revision: 1099964

URL: http://svn.apache.org/viewvc?rev=1099964&view=rev
Log:
[KARAF-572] - Command to show all registered servlets and their contexts
refactoring: - removed the CommandUtils out of the http and war bundle

Added:
    karaf/trunk/util/src/main/java/org/apache/karaf/util/CommandUtils.java   (with props)
Removed:
    karaf/trunk/shell/web/src/main/java/org/apache/karaf/shell/web/CommandUtils.java
Modified:
    karaf/trunk/shell/http/pom.xml
    karaf/trunk/shell/http/src/main/java/org/apache/karaf/shell/http/ServletListCommand.java
    karaf/trunk/shell/web/pom.xml
    karaf/trunk/shell/web/src/main/java/org/apache/karaf/shell/web/WebListCommand.java

Modified: karaf/trunk/shell/http/pom.xml
URL: http://svn.apache.org/viewvc/karaf/trunk/shell/http/pom.xml?rev=1099964&r1=1099963&r2=1099964&view=diff
==============================================================================
--- karaf/trunk/shell/http/pom.xml (original)
+++ karaf/trunk/shell/http/pom.xml Thu May  5 20:47:08 2011
@@ -64,6 +64,11 @@
 			<artifactId>servlet-api</artifactId>
 			<scope>provided</scope>
 		</dependency>
+		<dependency>
+			<groupId>org.apache.karaf</groupId>
+			<artifactId>org.apache.karaf.util</artifactId>
+			<scope>compile</scope>
+		</dependency>
 	</dependencies>
 
 	<build>
@@ -100,6 +105,7 @@
 						<Private-Package>
 							org.apache.felix.utils.version,
 							org.apache.felix.utils.manifest,
+							org.apache.karaf.util,
 							!*
                         </Private-Package>
 						<_versionpolicy>${bnd.version.policy}</_versionpolicy>

Modified: karaf/trunk/shell/http/src/main/java/org/apache/karaf/shell/http/ServletListCommand.java
URL: http://svn.apache.org/viewvc/karaf/trunk/shell/http/src/main/java/org/apache/karaf/shell/http/ServletListCommand.java?rev=1099964&r1=1099963&r2=1099964&view=diff
==============================================================================
--- karaf/trunk/shell/http/src/main/java/org/apache/karaf/shell/http/ServletListCommand.java
(original)
+++ karaf/trunk/shell/http/src/main/java/org/apache/karaf/shell/http/ServletListCommand.java
Thu May  5 20:47:08 2011
@@ -23,6 +23,7 @@ import javax.servlet.Servlet;
 
 import org.apache.felix.gogo.commands.Command;
 import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.apache.karaf.util.CommandUtils;
 import org.ops4j.pax.web.service.spi.ServletEvent;
 import org.ops4j.pax.web.service.spi.WebEvent;
 

Modified: karaf/trunk/shell/web/pom.xml
URL: http://svn.apache.org/viewvc/karaf/trunk/shell/web/pom.xml?rev=1099964&r1=1099963&r2=1099964&view=diff
==============================================================================
--- karaf/trunk/shell/web/pom.xml (original)
+++ karaf/trunk/shell/web/pom.xml Thu May  5 20:47:08 2011
@@ -39,6 +39,11 @@
             <groupId>org.ops4j.pax.web</groupId>
             <artifactId>pax-web-spi</artifactId>
         </dependency>
+        <dependency>
+        	<groupId>org.apache.karaf</groupId>
+        	<artifactId>org.apache.karaf.util</artifactId>
+        	<scope>compile</scope>
+        </dependency>
     </dependencies>
 
     <build>
@@ -75,6 +80,7 @@
                         <Private-Package>
                             org.apache.felix.utils.version,
                             org.apache.felix.utils.manifest,
+                            org.apache.karaf.util,
                             !*
                         </Private-Package>
                         <_versionpolicy>${bnd.version.policy}</_versionpolicy>

Modified: karaf/trunk/shell/web/src/main/java/org/apache/karaf/shell/web/WebListCommand.java
URL: http://svn.apache.org/viewvc/karaf/trunk/shell/web/src/main/java/org/apache/karaf/shell/web/WebListCommand.java?rev=1099964&r1=1099963&r2=1099964&view=diff
==============================================================================
--- karaf/trunk/shell/web/src/main/java/org/apache/karaf/shell/web/WebListCommand.java (original)
+++ karaf/trunk/shell/web/src/main/java/org/apache/karaf/shell/web/WebListCommand.java Thu
May  5 20:47:08 2011
@@ -20,6 +20,7 @@ import java.util.Map;
 
 import org.apache.felix.gogo.commands.Command;
 import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.apache.karaf.util.CommandUtils;
 import org.ops4j.pax.web.service.spi.WebEvent;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;

Added: karaf/trunk/util/src/main/java/org/apache/karaf/util/CommandUtils.java
URL: http://svn.apache.org/viewvc/karaf/trunk/util/src/main/java/org/apache/karaf/util/CommandUtils.java?rev=1099964&view=auto
==============================================================================
--- karaf/trunk/util/src/main/java/org/apache/karaf/util/CommandUtils.java (added)
+++ karaf/trunk/util/src/main/java/org/apache/karaf/util/CommandUtils.java Thu May  5 20:47:08
2011
@@ -0,0 +1,43 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.karaf.util;
+
+/**
+ * Contains various methods for helping with layout no commands
+ */
+public class CommandUtils {
+
+	/**
+	 * The message is either enlarged or trimmed to the given size. 
+	 * 
+	 * @param message - the message to be trimmed or enlarged
+	 * @param length - the length of the message text
+	 * @return the optimized message
+	 */
+	public static String trimToSize(String message, int length) {
+		while (message.length() < length) {
+			message += " ";
+		} 
+		if (message.length() > length) {
+			message = message.substring(0, length);
+		}
+		
+		return message;
+	}
+	
+}

Propchange: karaf/trunk/util/src/main/java/org/apache/karaf/util/CommandUtils.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message