private CMBlob getBlobByName ( CMFolder cmFolder , String baseName ) throws ParseException { StringBuilder innerXml = new StringBuilder ( ) ; innerXml . append ( "<folder id=" ) . append ( "'" ) . append ( cmFolder . getId ( ) ) . append ( "'" ) . append ( "/>" ) . append ( "<query>" ) . append ( "\"" ) . append ( XmlUtils . escape ( baseName ) ) . append ( "\"" ) . append ( "</query>" ) . append ( "<count>1</count>" ) ; HttpPost request = buildSoapRequest ( "queryFolder" , innerXml . toString ( ) ) ; CResponse response = retryStrategy . invokeRetry ( getApiRequestInvoker ( request , cmFolder . getCPath ( ) ) ) ; Document dom = response . asDom ( ) ; NodeList elementList = dom . getElementsByTagNameNS ( "*" , "entry" ) ; if ( elementList . getLength ( ) == 0 ) { return null ; } CMBlob cmBlob = CMBlob . buildCMFile ( cmFolder , ( Element ) elementList . item ( 0 ) ) ; return cmBlob ; }
Gets a blob according to the parent folder id of the folder .