gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r571415 - in /gump/mvnrepo/trunk: build.xml src/java/org/apache/gump/mvnrepo/Main.java src/java/org/apache/gump/mvnrepo/resources/GumpArtifact.java src/java/org/apache/gump/mvnrepo/resources/LogFile.java
Date Fri, 31 Aug 2007 10:17:38 GMT
Author: bodewig
Date: Fri Aug 31 03:17:38 2007
New Revision: 571415

URL: http://svn.apache.org/viewvc?rev=571415&view=rev
Log:
Actually log something - and show it as well

Modified:
    gump/mvnrepo/trunk/build.xml
    gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepo/Main.java
    gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepo/resources/GumpArtifact.java
    gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepo/resources/LogFile.java

Modified: gump/mvnrepo/trunk/build.xml
URL: http://svn.apache.org/viewvc/gump/mvnrepo/trunk/build.xml?rev=571415&r1=571414&r2=571415&view=diff
==============================================================================
--- gump/mvnrepo/trunk/build.xml (original)
+++ gump/mvnrepo/trunk/build.xml Fri Aug 31 03:17:38 2007
@@ -12,7 +12,8 @@
   </target>
 
   <target name="compile" depends="init">
-    <javac srcdir="src/java" destdir="${classes.dir}" source="5" target="5">
+    <javac srcdir="src/java" destdir="${classes.dir}" source="5"
+           target="5" debug="true">
       <classpath>
         <fileset dir="lib"/>
       </classpath>
@@ -29,4 +30,4 @@
       </classpath>
     </java>
   </target>
-</project>
\ No newline at end of file
+</project>

Modified: gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepo/Main.java
URL: http://svn.apache.org/viewvc/gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepo/Main.java?rev=571415&r1=571414&r2=571415&view=diff
==============================================================================
--- gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepo/Main.java (original)
+++ gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepo/Main.java Fri Aug 31 03:17:38 2007
@@ -20,6 +20,7 @@
 
 import org.apache.gump.mvnrepo.resources.Checksum;
 import org.apache.gump.mvnrepo.resources.Jar;
+import org.apache.gump.mvnrepo.resources.LogFile;
 import org.apache.gump.mvnrepo.restlets.ArtifactAdder;
 import org.apache.gump.mvnrepo.restlets.ArtifactsForm;
 import org.apache.gump.mvnrepo.restlets.Proxy;
@@ -68,6 +69,9 @@
                                   Jar.class);
                     router.attach(Constants.CHECKSUM_ARTIFACT_TEMPLATE,
                                   Checksum.class);
+
+                    // other resources
+                    router.attach("/proxyLog.html", LogFile.class);
 
                     // simple HTML form to add new artifacts
                     router.attach("/addartifact.html", new ArtifactsForm());

Modified: gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepo/resources/GumpArtifact.java
URL: http://svn.apache.org/viewvc/gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepo/resources/GumpArtifact.java?rev=571415&r1=571414&r2=571415&view=diff
==============================================================================
--- gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepo/resources/GumpArtifact.java (original)
+++ gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepo/resources/GumpArtifact.java Fri Aug
31 03:17:38 2007
@@ -59,6 +59,8 @@
      */
     @Override
     public Representation getRepresentation(Variant v) {
+        served.add(new LogEntry(fileName == null,
+                                getRequest().getResourceRef().getPath()));
         if (fileName != null) {
             log("serving " + fileName + " as");
             return getRepresentation(fileName);

Modified: gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepo/resources/LogFile.java
URL: http://svn.apache.org/viewvc/gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepo/resources/LogFile.java?rev=571415&r1=571414&r2=571415&view=diff
==============================================================================
--- gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepo/resources/LogFile.java (original)
+++ gump/mvnrepo/trunk/src/java/org/apache/gump/mvnrepo/resources/LogFile.java Fri Aug 31
03:17:38 2007
@@ -65,25 +65,25 @@
 	+ "</tr>\n";
 
     private static final String LINE_PATTERN =
-	"<tr class=\"%1$\">\n"
-	+ "<td>%2$</td>\n"
+	"<tr class=\"%1$s\">\n"
+	+ "<td>%2$d</td>\n"
 	+ "<td>%3$tc</td>\n"
-	+ "<td>%4$</td>\n"
-	+ "<td>%5$</td>\n"
+	+ "<td>%4$s</td>\n"
+	+ "<td>%5$s</td>\n"
 	+ "<td></td>\n"
 	+ "</tr>\n";
 
     private static final String FOOT_PATTERN =
 	"</table>\n"
-	+ "</body>\n"
 	+ "<p align=\"right\">Last Updated: %1$tc</p>\n"
+	+ "</body>\n"
 	+ "</html>\n";
 
     private static final String SUCCESS_ICON =
 	"<img src='gump_icons/success.png' alt='Success' />";
 
     private static final String PROXIED_ICON =
-	"<img src='gump_icons/success.png' alt='Failed' />";
+	"<img src='gump_icons/complete.png' alt='Proxied' />";
 
     public LogFile(Context ctx, Request request, Response response) {
         super(ctx, request, response);
@@ -97,10 +97,10 @@
 	for (LogEntry entry : GumpArtifact.getServedArtifacts()) {
 	    result.append(String.format(LINE_PATTERN,
 					!entry.hasBeenProxied()
-					? "SUCCESS" : "FAILURE",
+					? "SUCCESS" : "COMPLETE",
 					i++, entry.getServedAt(),
 					entry.getArtifactName(),
-					entry.hasBeenProxied()
+					!entry.hasBeenProxied()
 					? SUCCESS_ICON : PROXIED_ICON));
 	}
 	result.append(String.format(FOOT_PATTERN, new java.util.Date()));



Mime
View raw message