throw new ContentNotFoundException(
"Unable to get Versions on a non-directory: " + repoDir.getAbsolutePath() );
}
Set<String> foundVersions = new HashSet<String>();
VersionedReference versionRef = new VersionedReference();
versionRef.setGroupId( reference.getGroupId() );
versionRef.setArtifactId( reference.getArtifactId() );
File repoFiles[] = repoDir.listFiles();
for ( int i = 0; i < repoFiles.length; i++ )
{
if ( !repoFiles[i].isDirectory() )
{
// Skip it. not a directory.
continue;
}
// Test if dir has an artifact, which proves to us that it is a valid version directory.
String version = repoFiles[i].getName();
versionRef.setVersion( version );
if ( hasArtifact( versionRef ) )
{
// Found an artifact, must be a valid version.
foundVersions.add( version );