#vulnerable code 
                                public BinaryData download( String resourceId )
        throws ResourcesException
    {
        String resourcePath = getResourcePath( resourceId );
        File file = new File( getRootFolder(), resourcePath );
        try
        {
        	FileInputStream input = new FileInputStream(file);
        	byte[] content=IOUtils.toByteArray(input);
            //BinaryData data = new BinaryData( content, file.getName() );
        	BinaryData data = new BinaryData( );
        	data.setContent(input);
        	data.setFileName(file.getName());
            data.setResourceId( resourceId );
            return data;
        }
        catch ( Exception e )
        {
            throw new ResourcesException( e );
        }
    } 
                            #location 17 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                public BinaryData download( String resourceId )
        throws ResourcesException
    {
        String resourcePath = getResourcePath( resourceId );
        File file = new File( getRootFolder(), resourcePath );
        try
        {
        	FileInputStream input = new FileInputStream(file);
        	byte[] content=IOUtils.toByteArray(input);
            //BinaryData data = new BinaryData( content, file.getName() );
        	BinaryData data = new BinaryData( );
        	data.setContent(content);
        	data.setFileName(file.getName());
            data.setResourceId( resourceId );
            return data;
        }
        catch ( Exception e )
        {
            throw new ResourcesException( e );
        }
    }