continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r307112 - /maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/WorkingCopyContentGenerator.java
Date Fri, 07 Oct 2005 13:15:34 GMT
Author: evenisse
Date: Fri Oct  7 06:15:29 2005
New Revision: 307112

URL: http://svn.apache.org/viewcvs?rev=307112&view=rev
Log:
[CONTINUUM-338] Exclude scm files (CVS, .svn, ...)

Modified:
    maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/WorkingCopyContentGenerator.java

Modified: maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/WorkingCopyContentGenerator.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/WorkingCopyContentGenerator.java?rev=307112&r1=307111&r2=307112&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/WorkingCopyContentGenerator.java
(original)
+++ maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/WorkingCopyContentGenerator.java
Fri Oct  7 06:15:29 2005
@@ -64,28 +64,38 @@
 
             if ( !f.isDirectory() )
             {
-                String userDirectory = null;
+                String fileName = f.getName();
 
-                if ( f.getParentFile().getAbsolutePath().equals( basedir.getAbsolutePath()
) )
+                if ( !".cvsignore".equals( fileName ) && !"vssver.scc".equals( fileName
) && !".DS_Store".equals( fileName ) )
                 {
-                    userDirectory = "/";
-                }
-                else
-                {
-                    userDirectory = f.getParentFile().getAbsolutePath().substring( basedir.getAbsolutePath().length()
+ 1 );
-                }
+                    String userDirectory = null;
+
+                    if ( f.getParentFile().getAbsolutePath().equals( basedir.getAbsolutePath()
) )
+                    {
+                        userDirectory = "/";
+                    }
+                    else
+                    {
+                        userDirectory = f.getParentFile().getAbsolutePath().substring( basedir.getAbsolutePath().length()
+ 1 );
+                    }
 
-                userDirectory = StringUtils.replace( userDirectory, "\\", "/" );
+                    userDirectory = StringUtils.replace( userDirectory, "\\", "/" );
 
-                buf.append( indent + "&nbsp;&nbsp;&nbsp;<a href=\"" + baseUrl
+ "?userDirectory=" + userDirectory + "&file=" + f.getName() + "\">" + f.getName()
+ "</a><br />" );
+                    buf.append( indent + "&nbsp;&nbsp;&nbsp;<a href=\"" +
baseUrl + "?userDirectory=" + userDirectory + "&file=" + fileName + "\">" + fileName
+ "</a><br />" );
+                }
             }
             else
             {
-                String userDirectory = f.getAbsolutePath().substring( basedir.getAbsolutePath().length()
+ 1 );
+                String directoryName = f.getName();
+
+                if ( !"CVS".equals( directoryName ) && !".svn".equals( directoryName
) && !"SCCS".equals( directoryName ) )
+                {
+                    String userDirectory = f.getAbsolutePath().substring( basedir.getAbsolutePath().length()
+ 1 );
 
-                userDirectory = StringUtils.replace( userDirectory, "\\", "/" );
+                    userDirectory = StringUtils.replace( userDirectory, "\\", "/" );
 
-                buf.append( indent + "+&nbsp;<a href=\"" + baseUrl + "?userDirectory="
+ userDirectory + "\">" + f.getName() + "</a><br />" );
+                    buf.append( indent + "+&nbsp;<a href=\"" + baseUrl + "?userDirectory="
+ userDirectory + "\">" + directoryName + "</a><br />" );
+                }
             }
         }
         else



Mime
View raw message