summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2014-03-27 06:01:41 +0000
committerOlivier Lamy <olamy@apache.org>2014-03-27 06:01:41 +0000
commit5719fa8827456c108d32a5f403b984e53ee4bdf1 (patch)
treeebb9757a76a6df8cb2f2598019491289699d35af
parent5a1a064f75c43aee5c7d91d480c50bfd3973923e (diff)
downloadarchiva-5719fa8827456c108d32a5f403b984e53ee4bdf1.tar.gz
archiva-5719fa8827456c108d32a5f403b984e53ee4bdf1.zip
format code
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1582197 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java76
1 files changed, 39 insertions, 37 deletions
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java
index 5944d597b..b16d70440 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultBrowseService.java
@@ -199,7 +199,8 @@ public class DefaultBrowseService
}
for ( String project : projects )
{
- browseGroupResultEntries.add( new BrowseResultEntry( groupId + '.' + project, true ).groupId( groupId ).artifactId( project ) );
+ browseGroupResultEntries.add(
+ new BrowseResultEntry( groupId + '.' + project, true ).groupId( groupId ).artifactId( project ) );
}
Collections.sort( browseGroupResultEntries );
return new BrowseResult( browseGroupResultEntries );
@@ -280,9 +281,8 @@ public class DefaultBrowseService
}
catch ( MetadataResolutionException e )
{
- log.warn(
- "Skipping invalid metadata while compiling shared model for {}:{} in repo {}: {}",
- groupId, artifactId, repoId, e.getMessage() );
+ log.warn( "Skipping invalid metadata while compiling shared model for {}:{} in repo {}: {}",
+ groupId, artifactId, repoId, e.getMessage() );
}
}
}
@@ -361,50 +361,55 @@ public class DefaultBrowseService
(MavenProjectFacet) versionMetadata.getFacet( MavenProjectFacet.FACET_ID );
if ( versionMetadataMavenFacet != null )
{
- if ( mavenFacet.getPackaging() != null && !StringUtils.equalsIgnoreCase(
- mavenFacet.getPackaging(), versionMetadataMavenFacet.getPackaging() ) )
+ if ( mavenFacet.getPackaging() != null //
+ && !StringUtils.equalsIgnoreCase( mavenFacet.getPackaging(),
+ versionMetadataMavenFacet.getPackaging() ) )
{
mavenFacet.setPackaging( null );
}
}
- if ( StringUtils.isEmpty( sharedModel.getName() ) && !StringUtils.isEmpty(
- versionMetadata.getName() ) )
+ if ( StringUtils.isEmpty( sharedModel.getName() ) //
+ && !StringUtils.isEmpty( versionMetadata.getName() ) )
{
sharedModel.setName( versionMetadata.getName() );
}
- if ( sharedModel.getDescription() != null && !StringUtils.equalsIgnoreCase(
- sharedModel.getDescription(), versionMetadata.getDescription() ) )
+ if ( sharedModel.getDescription() != null //
+ && !StringUtils.equalsIgnoreCase( sharedModel.getDescription(),
+ versionMetadata.getDescription() ) )
{
sharedModel.setDescription( StringUtils.isNotEmpty( versionMetadata.getDescription() )
? versionMetadata.getDescription()
: "" );
}
- if ( sharedModel.getIssueManagement() != null && versionMetadata.getIssueManagement() != null
+ if ( sharedModel.getIssueManagement() != null //
+ && versionMetadata.getIssueManagement() != null //
&& !StringUtils.equalsIgnoreCase( sharedModel.getIssueManagement().getUrl(),
versionMetadata.getIssueManagement().getUrl() ) )
{
sharedModel.setIssueManagement( versionMetadata.getIssueManagement() );
}
- if ( sharedModel.getCiManagement() != null && versionMetadata.getCiManagement() != null
+ if ( sharedModel.getCiManagement() != null //
+ && versionMetadata.getCiManagement() != null //
&& !StringUtils.equalsIgnoreCase( sharedModel.getCiManagement().getUrl(),
versionMetadata.getCiManagement().getUrl() ) )
{
sharedModel.setCiManagement( versionMetadata.getCiManagement() );
}
- if ( sharedModel.getOrganization() != null && versionMetadata.getOrganization() != null
+ if ( sharedModel.getOrganization() != null //
+ && versionMetadata.getOrganization() != null //
&& !StringUtils.equalsIgnoreCase( sharedModel.getOrganization().getName(),
versionMetadata.getOrganization().getName() ) )
{
sharedModel.setOrganization( versionMetadata.getOrganization() );
}
- if ( sharedModel.getUrl() != null && !StringUtils.equalsIgnoreCase( sharedModel.getUrl(),
- versionMetadata.getUrl() ) )
+ if ( sharedModel.getUrl() != null //
+ && !StringUtils.equalsIgnoreCase( sharedModel.getUrl(), versionMetadata.getUrl() ) )
{
sharedModel.setUrl( versionMetadata.getUrl() );
}
@@ -474,8 +479,8 @@ public class DefaultBrowseService
{
// TODO: what about if we want to see this irrespective of version?
references.addAll(
- metadataResolver.resolveProjectReferences( repositorySession, repoId, groupId, artifactId,
- version ) );
+ metadataResolver.resolveProjectReferences( repositorySession, repoId, groupId, artifactId, version )
+ );
}
}
catch ( MetadataResolutionException e )
@@ -801,7 +806,8 @@ public class DefaultBrowseService
ArchivaArtifact archivaArtifact = new ArchivaArtifact( groupId, artifactId, version,
StringUtils.isEmpty( classifier )
? ""
- : classifier, "jar", repoId );
+ : classifier, "jar", repoId
+ );
File file = managedRepositoryContent.toFile( archivaArtifact );
if ( file != null && file.exists() )
@@ -822,18 +828,13 @@ public class DefaultBrowseService
int buildNumber = archivaRepositoryMetadata.getSnapshotVersion().getBuildNumber();
String timeStamp = archivaRepositoryMetadata.getSnapshotVersion().getTimestamp();
// rebuild file name with timestamped version and build number
- 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" );*/
+ 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(), timeStampFileName );
log.debug( "try to find timestamped snapshot version file: {}", timeStampFile.getPath() );
if ( timeStampFile.exists() )
@@ -954,23 +955,24 @@ public class DefaultBrowseService
while ( jarEntryEnumeration.hasMoreElements() )
{
JarEntry currentEntry = jarEntryEnumeration.nextElement();
- String cleanedEntryName =
- StringUtils.endsWith( currentEntry.getName(), "/" ) ? StringUtils.substringBeforeLast(
- currentEntry.getName(), "/" ) : currentEntry.getName();
+ String cleanedEntryName = StringUtils.endsWith( currentEntry.getName(), "/" ) ? //
+ StringUtils.substringBeforeLast( currentEntry.getName(), "/" ) : currentEntry.getName();
String entryRootPath = getRootPath( cleanedEntryName );
int depth = StringUtils.countMatches( cleanedEntryName, "/" );
- if ( StringUtils.isEmpty( filterPath ) && !artifactContentEntryMap.containsKey( entryRootPath )
+ if ( StringUtils.isEmpty( filterPath ) //
+ && !artifactContentEntryMap.containsKey( entryRootPath ) //
&& depth == filterDepth )
{
artifactContentEntryMap.put( entryRootPath,
new ArtifactContentEntry( entryRootPath, !currentEntry.isDirectory(),
- depth, repoId ) );
+ depth, repoId )
+ );
}
else
{
- if ( StringUtils.startsWith( cleanedEntryName, filterPath ) && ( depth == filterDepth || (
- !currentEntry.isDirectory() && depth == filterDepth ) ) )
+ if ( StringUtils.startsWith( cleanedEntryName, filterPath ) //
+ && ( depth == filterDepth || ( !currentEntry.isDirectory() && depth == filterDepth ) ) )
{
artifactContentEntryMap.put( cleanedEntryName, new ArtifactContentEntry( cleanedEntryName,
!currentEntry.isDirectory(),