public static SnapshotVersion clone( SnapshotVersion snapshotVersion ) { if ( snapshotVersion == null ) { return null; } SnapshotVersion cloned = new SnapshotVersion(); cloned.setTimestamp( snapshotVersion.getTimestamp() ); cloned.setBuildNumber( snapshotVersion.getBuildNumber() ); return cloned; }
if ( snapshotVersion != null ) String lastVersion = snapshotVersion.getTimestamp(); int buildNumber = snapshotVersion.getBuildNumber(); String snapshotPath = StringUtils.replaceChars( groupId, '.', '/' ) + '/' + artifactId + '/' + version + '/'
/** * Update version level metadata for snapshot artifacts. If it does not exist, create the metadata and fix checksums * if necessary. */ private void updateVersionMetadata( ArchivaRepositoryMetadata metadata, Path metadataFile, Date lastUpdatedTimestamp, String timestamp, int buildNumber, boolean fixChecksums, FileMetadata fileMetadata, String groupId, String artifactId, String version, String packaging ) throws RepositoryMetadataException { if ( !Files.exists(metadataFile) ) { metadata.setGroupId( groupId ); metadata.setArtifactId( artifactId ); metadata.setVersion( version ); } if ( metadata.getSnapshotVersion() == null ) { metadata.setSnapshotVersion( new SnapshotVersion() ); } metadata.getSnapshotVersion().setBuildNumber( buildNumber ); metadata.getSnapshotVersion().setTimestamp( timestamp ); metadata.setLastUpdatedTimestamp( lastUpdatedTimestamp ); RepositoryMetadataWriter.write( metadata, metadataFile ); if ( fixChecksums ) { fixChecksums( metadataFile ); } }
if ( versionMetadata.getSnapshotVersion() != null ) newBuildNumber = versionMetadata.getSnapshotVersion().getBuildNumber() + 1;
if ( snapshotVersion != null ) String lastVersion = snapshotVersion.getTimestamp(); int buildNumber = snapshotVersion.getBuildNumber(); String snapshotPath = StringUtils.replaceChars( groupId, '.', '/' ) + '/' + artifactId + '/' + version + '/'
/** * Update version level metadata for snapshot artifacts. If it does not exist, create the metadata and fix checksums * if necessary. */ private void updateVersionMetadata( ArchivaRepositoryMetadata metadata, File metadataFile, Date lastUpdatedTimestamp, String timestamp, int buildNumber, boolean fixChecksums, FileMetadata fileMetadata, String groupId, String artifactId, String version, String packaging ) throws RepositoryMetadataException { if ( !metadataFile.exists() ) { metadata.setGroupId( groupId ); metadata.setArtifactId( artifactId ); metadata.setVersion( version ); } if ( metadata.getSnapshotVersion() == null ) { metadata.setSnapshotVersion( new SnapshotVersion() ); } metadata.getSnapshotVersion().setBuildNumber( buildNumber ); metadata.getSnapshotVersion().setTimestamp( timestamp ); metadata.setLastUpdatedTimestamp( lastUpdatedTimestamp ); RepositoryMetadataWriter.write( metadata, metadataFile ); if ( fixChecksums ) { fixChecksums( metadataFile ); } }
if ( versionMetadata.getSnapshotVersion() != null ) newBuildNumber = versionMetadata.getSnapshotVersion().getBuildNumber() + 1;
public static SnapshotVersion clone( SnapshotVersion snapshotVersion ) { if ( snapshotVersion == null ) { return null; } SnapshotVersion cloned = new SnapshotVersion(); cloned.setTimestamp( snapshotVersion.getTimestamp() ); cloned.setBuildNumber( snapshotVersion.getBuildNumber() ); return cloned; }
int buildNumber = archivaRepositoryMetadata.getSnapshotVersion().getBuildNumber(); String timeStamp = archivaRepositoryMetadata.getSnapshotVersion().getTimestamp();
if ( m.matches() ) metadata.setSnapshotVersion( new SnapshotVersion() ); int buildNumber = NumberUtils.toInt( m.group( 3 ), -1 ); metadata.getSnapshotVersion().setBuildNumber( buildNumber ); metadata.getSnapshotVersion().setTimestamp( m.group( 2 ) ); metadata.setSnapshotVersion( new SnapshotVersion() );
private static SnapshotVersion merge( SnapshotVersion mainSnapshotVersion, SnapshotVersion sourceSnapshotVersion ) { if ( sourceSnapshotVersion == null ) { return mainSnapshotVersion; } if ( mainSnapshotVersion == null ) { return ArchivaModelCloner.clone( sourceSnapshotVersion ); } SnapshotVersion merged = new SnapshotVersion(); long mainSnapshotLastUpdated = convertTimestampToLong(mainSnapshotVersion.getTimestamp()); long sourceSnapshotLastUpdated = convertTimestampToLong(sourceSnapshotVersion.getTimestamp()); long lastUpdated = mergeTimestamp(mainSnapshotLastUpdated, sourceSnapshotLastUpdated); if (lastUpdated == mainSnapshotLastUpdated) { merged.setTimestamp(mainSnapshotVersion.getTimestamp()); merged.setBuildNumber(mainSnapshotVersion.getBuildNumber()); } else { merged.setTimestamp(sourceSnapshotVersion.getTimestamp()); merged.setBuildNumber(sourceSnapshotVersion.getBuildNumber()); } return merged; }
int buildNumber = archivaRepositoryMetadata.getSnapshotVersion().getBuildNumber(); String timeStamp = archivaRepositoryMetadata.getSnapshotVersion().getTimestamp();
if ( snapshotElem != null ) SnapshotVersion snapshot = new SnapshotVersion(); snapshot.setTimestamp( snapshotElem.elementTextTrim( "timestamp" ) ); String tmp = snapshotElem.elementTextTrim( "buildNumber" ); if ( NumberUtils.isNumber( tmp ) ) snapshot.setBuildNumber( NumberUtils.toInt( tmp ) );
if ( snapshot != null ) String timestamp = snapshot.getTimestamp(); int buildNumber = snapshot.getBuildNumber();
if ( snapshotElem != null ) SnapshotVersion snapshot = new SnapshotVersion(); snapshot.setTimestamp( snapshotElem.elementTextTrim( "timestamp" ) ); String tmp = snapshotElem.elementTextTrim( "buildNumber" ); if ( NumberUtils.isNumber( tmp ) ) snapshot.setBuildNumber( NumberUtils.toInt( tmp ) );
int buildNumber = archivaRepositoryMetadata.getSnapshotVersion().getBuildNumber(); String timeStamp = archivaRepositoryMetadata.getSnapshotVersion().getTimestamp();
int buildNumber = archivaRepositoryMetadata.getSnapshotVersion().getBuildNumber(); String timeStamp = archivaRepositoryMetadata.getSnapshotVersion().getTimestamp();
timestampVersion = timestampVersion + snapshotVersion.getTimestamp() + "-" + snapshotVersion.getBuildNumber();
timestampVersion = timestampVersion + snapshotVersion.getTimestamp() + "-" + snapshotVersion.getBuildNumber();
int buildNumber = archivaRepositoryMetadata.getSnapshotVersion().getBuildNumber(); String timestamp = archivaRepositoryMetadata.getSnapshotVersion().getTimestamp();