public static Map convertToMap(List list) {
Map map = new HashMap( list.size() );
for ( Iterator it = list.iterator(); it.hasNext(); ) {
ScmEntry entry = (ScmEntry) it.next();
if ( entry.isDirectory() ) {
map.put( entry.getPath().equals( "" ) ? entry.getName() : entry.getPath() + "/" + entry.getName(),
entry );
} else {
List files = (List) map.get( entry.getPath() );
if ( files == null ) {
files = new ArrayList();
map.put( entry.getPath(),
files );
}
files.add( entry );
}