List entries = new ArrayList();
String parentPath = path;
for ( Iterator pkgIter = pkgs.iterator(); pkgIter.hasNext(); ) {
PackageItem item = (PackageItem) pkgIter.next();
DefaultScmEntry scmEntry = new DefaultScmEntry();
scmEntry.setPath( parentPath );
String name = toDirectoryName( item.getName() ).substring( parentPath.length() );
scmEntry.setName( name );
scmEntry.setAuthor( item.getPublisher() );
scmEntry.setDate( item.getLastModified().getTime() );
scmEntry.setRevision( new Long( item.getVersionNumber() ).longValue() );
scmEntry.setSize( 0 );
scmEntry.setType( ScmEntry.DIRECTORY );
entries.add( scmEntry );
String pkgNameAsPath = toDirectoryName( item.getName() );
for ( Iterator assetIter = item.getAssets(); assetIter.hasNext(); ) {
AssetItem assetItem = (AssetItem) assetIter.next();
if (!(assetItem.getVersionNumber() == 0)) {
scmEntry = new DefaultScmEntry();
scmEntry.setPath( pkgNameAsPath );
scmEntry.setName( toFileName( assetItem ) );
scmEntry.setAuthor( assetItem.getPublisher() );
scmEntry.setDate( assetItem.getLastModified().getTime() );
scmEntry.setRevision( new Long( assetItem.getVersionNumber() ).longValue() );
scmEntry.setSize( 0 );
scmEntry.setType( ScmEntry.FILE );
entries.add( scmEntry );
}
}
}