Bug 166729 [Linux]setImageDirectory() method is no effect[0600]
Description: [Linux]setImageDirectory() method is no effect[0600] Step: 1.Run the test case by junit. You can find out the case on: /cvsroot/org.eclipse.birt.report.tests.engine/src/org/eclipse/birt/report/tests/engine/regression/Regression_142894.java /cvsroot/org.eclipse.birt.report.tests.engine/src/org/eclipse/birt/report/tests/engine/regression/input/regression_142894.rptdesign /cvsroot/org.eclipse.birt.report.tests.engine/src/org/eclipse/birt/report/tests/engine/regression/input/pics/green.bmp 2.In render task, we set that "renderContext.setImageDirectory( "image" );" Actual result: The background image path is "pics/green.bmp" in html code. But the image is save at "image/green.bmp"
model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/api/util/URIUtil.java
if ( FILE_SCHEMA.equalsIgnoreCase( url.getProtocol( ) ) )
			return getFileDirectory( url.getPath( ) );
		else if ( JAR_SCHEMA.equalsIgnoreCase( url.getProtocol( ) )
				&& !url.getPath( ).toLowerCase( ).startsWith( HTTP_SCHEMA ) )
			return getJarDirectory( url.getPath( ) );
		
		return getNetDirectory( url );
	}
	/**
	 * Returns the directory of a file path that is a url with network
	 * protocols. Note that <code>filePath</code> should include the file name
	 * and file extension.
	 * 
	 * @param filePath
	 *            the file url
	 * @return a url for the directory of the file
	 */
	private static URL getNetDirectory( URL filePath )
	{
		assert filePath != null;
		String path = filePath.getFile( );
		
		int index = path.lastIndexOf( '/' );
		if ( index != -1 && index != path.length( ) - 1 )
			path = path.substring( 0, index + 1 );
		try
		{
			return new URL( filePath.getProtocol( ), filePath.getHost( ),
					filePath.getPort( ), path );
		}