Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
CSExtendedAttribute
artor
Hi All,
Here is my new post, I am exploring CSExtendedAttribute and from my code I am calling this like
CSSimpleFile csf=(CSSimpleFile)file;
CSExtendedAttribute[] csea=csf.getExtendedAttributes(eaNameList);
In the above code eaNameList is the array of all extended attribute names which I hard coded in my code.
Actually what i want that If i get the file object csf, it should give me all the name of extended attributes which are already stored in the file
then i don't need to create the array and hard code all names of extended attribute. this make my code more robust.
But I haven't got any method in both the object objects, so if any body knows about them.
Please let me know.
Regards,
Find more posts tagged with
Comments
artor
Here I have found the solution of my self.
getExtendedAttribute(null);
It gives you all the extended attribute and value of that particular file.
Regards,
PaulW
it appears when i use this method to get all extended attributes and then reqrite them using:
((CSSimpleFile)targetFile).setExtendedAttributes(csea);
If there are any special characters in the extended attributes, they turn into garbage. Does anyone know of anything I need to do to copy extended attributes containing extended characters.
thanks
Ottawa_IWOV
Hi Artor -
Can you give an example of what format the EA Name should be in? For example, TeamSite/Metadata/Title or something like that?
Thanks,
kirthiraman
I am also looking for something such as csfile.getVarNameToValueMap() which will return a HashMap and from that I can iterate through all key,value pairs. Where csfile is of the type CSFile or CSSimpleFile.
Anybody who knows this please help.
kirthiraman
I guess I originally did not look at the earlier message in this thread. The following worked for me. If this is useful for anyone.
CSFile file; // get the file some sort
if ( file.getKind() == CSSimpleFile.KIND){
CSExtendedAttribute[] pairValues = ((CSSimpleFile) file).getExtendedAttributes(null);
if ( pairValues != null ){
// loop through the pairValues to get Name and Value
}
}
This one worked for me well. So I thought I would share.