repo.createFolder( f.getId(), new RepositoryFile.Builder( "folder1" ).folder( true ).build(), null );
assertNotNull( folder1 );
assertEquals( "folder1", folder1.getName() );
assertNotNull( folder1.getId() );
NodeRepositoryFileData data = makeNodeRepositoryFileData1();
logger.info( "createFile" );
RepositoryFile file1 =
repo.createFile( folder1.getId(), new RepositoryFile.Builder( "file1.whatever" ).versioned( true ).build(),
data, null );
assertNotNull( file1 );
assertNotNull( file1.getId() );
logger.info( "getDataForRead" );
NodeRepositoryFileData file1Data = repo.getDataForRead( file1.getId(), NodeRepositoryFileData.class );
assertNotNull( file1Data );
assertEquals( "testNode", file1Data.getNode().getName() );
assertEquals( "hello world", file1Data.getNode().getProperty( "prop1" ).getString() );
assertEquals( false, file1Data.getNode().getProperty( "prop2" ).getBoolean() );
assertEquals( DataPropertyType.BOOLEAN, file1Data.getNode().getProperty( "prop2" ).getType() );
assertEquals( 12L, file1Data.getNode().getProperty( "prop3" ).getLong() );
logger.info( "createFile (binary)" );
SimpleRepositoryFileData simpleData =
new SimpleRepositoryFileData( new ByteArrayInputStream( "Hello World!".getBytes( "UTF-8" ) ), "UTF-8",
"text/plain" );