congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
VersionUtil.isSnapshot
Code IndexAdd Tabnine to your IDE (free)

How to use
isSnapshot
method
in
org.apache.archiva.common.utils.VersionUtil

Best Java code snippets using org.apache.archiva.common.utils.VersionUtil.isSnapshot (Showing top 20 results out of 315)

origin: apache/archiva

private boolean isProjectVersion( Path dir )
{
  final String artifactId = dir.getParent().getFileName().toString();
  final String projectVersion = dir.getFileName().toString();
  // check if there is a POM artifact file to ensure it is a version directory
  Predicate<Path> filter;
  if ( VersionUtil.isSnapshot( projectVersion ) )
  {
    filter = new PomFilenameFilter(artifactId, projectVersion);
  }
  else
  {
    final String pomFile = artifactId + "-" + projectVersion + ".pom";
    filter = new PomFileFilter(pomFile);
  }
  try(Stream<Path> stream = Files.list(dir)) {
    if (stream.filter(Files::isRegularFile).anyMatch(filter)){
      return true;
    }
  } catch (IOException e) {
    LOGGER.error("Could not list directory {}: {}", dir, e.getMessage(), e);
  }
  // if a metadata file is present, check if this is the "version" directory, marking it as a project version
  ArchivaRepositoryMetadata metadata = readMetadata( dir );
  if ( metadata != null && projectVersion.equals( metadata.getVersion() ) )
  {
    return true;
  }
  return false;
}
origin: apache/archiva

if ( VersionUtil.isSnapshot( version ) )
origin: org.apache.archiva/maven2-repository

private boolean isProjectVersion( File dir )
{
  final String artifactId = dir.getParentFile().getName();
  final String projectVersion = dir.getName();
  // check if there is a POM artifact file to ensure it is a version directory
  File[] files;
  if ( VersionUtil.isSnapshot( projectVersion ) )
  {
    files = dir.listFiles( new PomFilenameFilter( artifactId, projectVersion ) );
  }
  else
  {
    final String pomFile = artifactId + "-" + projectVersion + ".pom";
    files = dir.listFiles( new PomFileFilter( pomFile ) );
  }
  if ( files != null && files.length > 0 )
  {
    return true;
  }
  // if a metadata file is present, check if this is the "version" directory, marking it as a project version
  ArchivaRepositoryMetadata metadata = readMetadata( dir );
  if ( metadata != null && projectVersion.equals( metadata.getVersion() ) )
  {
    return true;
  }
  return false;
}
origin: apache/archiva

  private void mergeWithOutSnapshots( MetadataRepository metadataRepository, List<ArtifactMetadata> sourceArtifacts,
                    String sourceRepoId, String repoid )
    throws RepositoryMergerException
  {
    List<ArtifactMetadata> artifactsWithOutSnapshots = new ArrayList<>();
    for ( ArtifactMetadata metadata : sourceArtifacts )
    {
      if ( VersionUtil.isSnapshot( metadata.getProjectVersion() ) )
      //if ( metadata.getProjectVersion().contains( VersionUtil.SNAPSHOT ) )
      {
        artifactsWithOutSnapshots.add( metadata );
      }
      else
      {
        triggerAuditEvent( repoid, metadata.getId(), AuditEvent.MERGING_REPOSITORIES );
      }

    }
    sourceArtifacts.removeAll( artifactsWithOutSnapshots );

    Filter<ArtifactMetadata> artifactListWithOutSnapShots = new IncludesFilter<ArtifactMetadata>( sourceArtifacts );
    repositoryMerger.merge( metadataRepository, sourceRepoId, repoid, artifactListWithOutSnapShots );
  }
}
origin: org.apache.archiva/archiva-rest-services

  private void mergeWithOutSnapshots( MetadataRepository metadataRepository, List<ArtifactMetadata> sourceArtifacts,
                    String sourceRepoId, String repoid )
    throws RepositoryMergerException
  {
    List<ArtifactMetadata> artifactsWithOutSnapshots = new ArrayList<>();
    for ( ArtifactMetadata metadata : sourceArtifacts )
    {
      if ( VersionUtil.isSnapshot( metadata.getProjectVersion() ) )
      //if ( metadata.getProjectVersion().contains( VersionUtil.SNAPSHOT ) )
      {
        artifactsWithOutSnapshots.add( metadata );
      }
      else
      {
        triggerAuditEvent( repoid, metadata.getId(), AuditEvent.MERGING_REPOSITORIES );
      }

    }
    sourceArtifacts.removeAll( artifactsWithOutSnapshots );

    Filter<ArtifactMetadata> artifactListWithOutSnapShots = new IncludesFilter<ArtifactMetadata>( sourceArtifacts );
    repositoryMerger.merge( metadataRepository, sourceRepoId, repoid, artifactListWithOutSnapShots );
  }
}
origin: org.apache.archiva/archiva-model

public ArchivaArtifact( ArchivaArtifactModel artifactModel )
{
  this.model = artifactModel;
  model.setSnapshot( VersionUtil.isSnapshot( model.getVersion() ) );
  this.baseVersion = VersionUtil.getBaseVersion( model.getVersion() );
}

origin: apache/archiva

public ArchivaArtifact( ArchivaArtifactModel artifactModel )
{
  this.model = artifactModel;
  model.setSnapshot( VersionUtil.isSnapshot( model.getVersion() ) );
  this.baseVersion = VersionUtil.getBaseVersion( model.getVersion() );
}

origin: apache/archiva

if ( VersionUtil.isSnapshot( artifact.getVersion() ) )
origin: apache/archiva

if ( VersionUtil.isSnapshot( version ) && !managedRepository.isSnapshots() )
origin: apache/archiva

projectMetadata.setAvailableVersions( availableVersions );
if ( !VersionUtil.isSnapshot( version ) )
origin: org.apache.archiva/archiva-web-common

projectMetadata.setAvailableVersions( availableVersions );
if ( !VersionUtil.isSnapshot( version ) )
origin: apache/archiva

if ( VersionUtil.isSnapshot( artifact.getVersion( ) ) )
origin: apache/archiva

if ( !VersionUtil.isSnapshot( artifact.getVersion() ) )
origin: org.apache.archiva/archiva-rest-services

if ( !VersionUtil.isSnapshot( artifact.getVersion() ) )
origin: org.apache.archiva/archiva-core-consumers

if ( VersionUtil.isSnapshot( artifact.getVersion() ) )
origin: org.apache.archiva/archiva-rest-services

projectMetadata.setAvailableVersions( availableVersions );
if ( !VersionUtil.isSnapshot( artifactTransferRequest.getVersion() ) )
origin: apache/archiva

projectMetadata.setAvailableVersions( availableVersions );
if ( !VersionUtil.isSnapshot( artifactTransferRequest.getVersion() ) )
origin: org.apache.archiva/archiva-model

model.setClassifier( StringUtils.defaultString( classifier ) );
model.setType( type );
model.setSnapshot( VersionUtil.isSnapshot( version ) );
model.setRepositoryId(repositoryId);
origin: apache/archiva

model.setClassifier( StringUtils.defaultString( classifier ) );
model.setType( type );
model.setSnapshot( VersionUtil.isSnapshot( version ) );
model.setRepositoryId(repositoryId);
origin: apache/archiva

projectMetadata.setLastUpdatedTimestamp( lastUpdatedTimestamp );
if ( !VersionUtil.isSnapshot( artifactMetadata.getVersion() ) )
org.apache.archiva.common.utilsVersionUtilisSnapshot

Popular methods of VersionUtil

  • getBaseVersion
  • isGenericSnapshot
  • isUniqueSnapshot
  • getReleaseVersion
    Get the release version of the snapshot version. If snapshot version is 1.0-SNAPSHOT, then releas
  • isVersion
    Tests if the unknown string contains elements that identify it as a version string (or not). The

Popular in Java

  • Running tasks concurrently on multiple threads
  • requestLocationUpdates (LocationManager)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • addToBackStack (FragmentTransaction)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now