Menu

#7 BlobContainer::setContainerMetadata() sets keys to lowercase

open
nobody
SDK (70)
7
2009-11-04
2009-11-04
No

BlobContainer::setContainerMetadata() sets keys within NameValueCollection objMetadata when stored in cloud.

For example, "createBy" becomes "createby", when returned after getting Blob Container and reading NameValueCollection metadata from ContainerProperties.

Discussion

  • chuwei huang

    chuwei huang - 2009-11-04

    According to document at
    http://msdn.microsoft.com/en-us/library/dd179404.aspx,
    Names are case-insensitive. If two or more headers with the same name are
    submitted for a resource, the headers will be combined into a single header
    with a comma delimiting each value.

    The total size of the metadata, including both the name and value
    together, may not exceed 8 KB in size.

    Metadata name/value pairs are valid HTTP headers, and so they adhere to
    all restrictions governing HTTP headers.

     
  • jeff00seattle

    jeff00seattle - 2009-11-04

    Thereby,
    MetadataContainer.get( "createBy" ) will return null, because it does not exist. That is because key was renamed to "createby".

     
  • jeff00seattle

    jeff00seattle - 2009-11-04

    I have add a JUnit pertaining to this issue.

    If Names are case-insensitive, then should not all of the following return the same value?:
    NameValueCollection::get( "createBy" )
    NameValueCollection::get( "createby" )
    NameValueCollection::get( "CREATEDBY" )

    If this is the case, then there is still a bug, because only lowercase is returning a value.
    NameValueCollection::get( "createby" );

    The fix would be for NameValueCollection::get( String strName ) to treat strName as case-insensitive, and not expect the SDK user to change strName to lowercase.

     
  • jeff00seattle

    jeff00seattle - 2009-11-04
    • labels: --> SDK
     
  • jeff00seattle

    jeff00seattle - 2009-11-04
    • priority: 5 --> 7
     
  • Nobody/Anonymous

    I think there is some misunderstanding. You should verify

    assertEquals( "Window Azure SDK for Java",objMetadataPost.getSingleValue("createdBy") );
    assertEquals( "Window Azure SDK for Java",objMetadataPost.getSingleValue("createdby") );
    assertEquals( "Window Azure SDK for Java",objMetadataPost.getSingleValue("CREATEDBY") );

    Instead of verifying
    assertTrue(objMetadataPost.containsKey("createdBy"));

     
  • jeff00seattle

    jeff00seattle - 2009-11-13

    Updated JUnit test

     
  • jeff00seattle

    jeff00seattle - 2009-11-13

    Problem varified with new test:
    String strValue = null;

    strValue = objMetadataPost.getSingleValue("createdBy");
    assertNotNull(strValue);
    assertEquals( "Window Azure SDK for Java",strValue );

    strValue = objMetadataPost.getSingleValue("CREATEDBY");
    assertNotNull(strValue);
    assertEquals( "Window Azure SDK for Java",strValue );

    strValue = objMetadataPost.getSingleValue("createdby");
    assertNotNull(strValue);
    assertEquals( "Window Azure SDK for Java",strValue );

     
  • chuwei huang

    chuwei huang - 2010-01-15

    already fixed

     
  • David Kocher

    David Kocher - 2010-07-16

    The issue is not fixed in the latest version available in the SVN.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.