code: public static void copyInstanceResources( Instance instance, Map<String,byte[]> fileNameToFileContent )
  	throws IOException {
  
  		File dir = InstanceHelpers.findInstanceDirectoryOnAgent( instance );
  		Utils.createDirectory( dir );
  
  		if( fileNameToFileContent != null ) {
  			for( Map.Entry<String,byte[]> entry : fileNameToFileContent.entrySet()) {
  
  				File f = new File( dir, entry.getKey());
  				Utils.createDirectory( f.getParentFile());
  
  				ByteArrayInputStream in = new ByteArrayInputStream( entry.getValue());
  				Utils.copyStream( in, f );
  			}
  		}
  	}
docs: Copies the resources of an instance on the disk.
  @param instance an instance
  @param fileNameToFileContent the files to write down (key = relative file location, value = file's content)
  @throws IOException if the copy encountered a problem