// /////////////////////////
private void setupDirectoryForListTest( int numSubDirs, int numFiles,
int numSubSubObjects, String baseDir )
{
CloudStoreAdapterBase store = getCloudStoreAdapter( );
store.createDirectory( store.getDirectory( baseDir ) );
for ( int i = 0; i < numSubDirs; i++ )
{
String dirPath = baseDir + "dir_" + i + "/";
CloudStoreDirectory dir = store.getDirectory( dirPath );
store.createDirectory( dir );
// create files and directories under each subdir
// in order to test recursive functionality
for ( int j = 0; j < numSubSubObjects; j++ )
{
CloudStoreDirectory subDir = store.getDirectory( dirPath
+ "sub_dir_" + j + "/" );
store.createDirectory( subDir );
CloudStoreFile subFile = store.getFile( dirPath + "sub_file_"
+ j );
subFile.setStreamToStore( new MockFileStream( 50 ) );
subFile.write( null );
}
}
for ( int i = 0; i < numFiles; i++ )
{
String filePath = baseDir + "file_" + i;
CloudStoreFile file = store.getFile( filePath );
file.setStreamToStore( new MockFileStream( 50 ) );
file.write( null );
}
}