output.setPrefix( bucket.getPrefix( ) );
List<ListEntry> outputContents = output.getContents( );
for ( Metadata meta : contents )
{
ListEntry entry = new ListEntry( );
entry.setETag( String.valueOf( meta.getMd5( ) ) );
entry.setKey( meta.getKey( ) );
try
{
entry.setLastModified( DatatypeFactory.newInstance( )
.newXMLGregorianCalendar(
meta
.getLastModified( ).toGregorianCalendar( ) ) );
}
catch ( DatatypeConfigurationException e )
{
throw new CloudStoreException( e );
}
entry.setSize( meta.getSize( ) );
entry.setStorageClass( StorageClass
.valueOf( meta.getStorageClass( ) ) );
outputContents.add( entry );
}
return output;
}