]> source.dussan.org Git - archiva.git/commitdiff
use StringBuilder and add a debug log
authorOlivier Lamy <olamy@apache.org>
Thu, 25 Apr 2013 11:30:28 +0000 (11:30 +0000)
committerOlivier Lamy <olamy@apache.org>
Thu, 25 Apr 2013 11:30:28 +0000 (11:30 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1475710 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java

index a9e6e042c5598a81f47eb20d27e6badbec4a94fb..7fdbf4e929c705686bbadac2cd51d2e446b43e87 100644 (file)
@@ -822,12 +822,20 @@ public class DefaultBrowseService
                             int buildNumber = archivaRepositoryMetadata.getSnapshotVersion().getBuildNumber();
                             String timeStamp = archivaRepositoryMetadata.getSnapshotVersion().getTimestamp();
                             // rebuild file name with timestamped version and build number
-                            File timeStampFile = new File( file.getParent(), artifactId + "-" + StringUtils.remove( version,
-                                                                                                              "-"
-                                                                                                                  + VersionUtil.SNAPSHOT )
-                                + "-" + timeStamp + "-" + Integer.toString( buildNumber ) + ( StringUtils.isEmpty(
-                                classifier ) ? "" : "-" + classifier ) + ".jar" );
-
+                            String timeStampFileName = new StringBuilder( artifactId ).append( '-' ).append(
+                                StringUtils.remove( version, "-" + VersionUtil.SNAPSHOT ) ).append( '-' ).append(
+                                timeStamp ).append( '-' ).append( Integer.toString( buildNumber ) ).append(
+                                ( StringUtils.isEmpty( classifier ) ? "" : "-" + classifier ) ).append(
+                                ".jar" ).toString();
+                            /*File timeStampFile = new File( file.getParent(),
+                                                           artifactId + "-" + StringUtils.remove( version, "-"
+                                                               + VersionUtil.SNAPSHOT ) + "-" + timeStamp + "-"
+                                                               + Integer.toString( buildNumber )
+                                                               + ( StringUtils.isEmpty( classifier )
+                                                               ? ""
+                                                               : "-" + classifier ) + ".jar" );*/
+                            File timeStampFile = new File( file.getParent(), timeStampFileName );
+                            log.debug( "try to find timestamped snapshot version file: {}", timeStampFile.getPath() );
                             if ( timeStampFile.exists() )
                             {
                                 return true;