From 202feaa707d8b2aa5d4a9a2829fa772d789b414b Mon Sep 17 00:00:00 2001 From: Brett Porter Date: Fri, 18 Apr 2008 08:11:17 +0000 Subject: [PATCH] sort the files on the index git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@649401 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/archiva/webdav/util/IndexWriter.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/IndexWriter.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/IndexWriter.java index 5c7beb917..4c41a6ee9 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/IndexWriter.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/IndexWriter.java @@ -22,7 +22,11 @@ package org.apache.maven.archiva.webdav.util; import org.apache.jackrabbit.webdav.DavResource; import org.apache.jackrabbit.webdav.io.OutputContext; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; import java.util.Date; +import java.util.List; import java.io.PrintWriter; import java.io.File; @@ -91,7 +95,10 @@ public class IndexWriter private void writeHyperlinks(PrintWriter writer) { - for (File file : localResource.listFiles()) + List files = new ArrayList( Arrays.asList( localResource.listFiles() ) ); + Collections.sort( files ); + + for ( File file : files ) { writeHyperlink(writer, file.getName(), file.isDirectory()); } -- 2.39.5