@Test( expected = IOException.class )
public void testInstanceResources_exception_subDir() throws Exception {

	// The directory where we should write contains a conflicting file.
	// Prepare our resources
	TestApplicationTemplate app = new TestApplicationTemplate();
	Map<String,byte[]> fileNameToFileContent = new HashMap<> ();
	fileNameToFileContent.put( "dir1/dir2/f3.txt", "I am file 3".getBytes( "UTF-8" ));
	File dir = InstanceHelpers.findInstanceDirectoryOnAgent( app.getTomcat());
	Utils.deleteFilesRecursively( dir );
	Assert.assertFalse( dir.exists());
	Assert.assertTrue( dir.mkdirs());
	Assert.assertTrue( new File( dir, "dir1" ).createNewFile());
	// Save our resources
	try {
		AgentUtils.copyInstanceResources( app.getTomcat(), fileNameToFileContent );
	} finally {
		Utils.deleteFilesRecursively( dir );
	}
}