small typo

Alan Bateman Alan.Bateman at Sun.COM
Fri Jun 6 05:06:38 PDT 2008


Rajendra Gutupalli wrote:
> Hi Alan,
>
> I started looking at NamedAttributeView. I am just trying in Windows XP.
> I noticed a small typo in method NamedAttributeView#write at " Where
> there is insufficient spec" (referring Javadoc b91).
> It supposed to be spelled as "space". 
Yes, should be "space" - thanks!

> Alan, could you please tell me how
> can I add sub file(named attribute) manually in Windows. I thought what
> ever name-value attributes I add
> to the file, should be visible in Properties(Right click + property +
> summary tab) window of the file. Is that correct?
AFAIK, the "Summary" tab in explorer only reads the contents of data 
streams that Windows knows about (as it needs to interpret the contents 
to display them). The usual way to create alternative streams is to 
append a colon and the stream name to the file name, eg:
 dir > foo:info
will direct the output of the dir command to a data stream named "info" 
for file foo.

If it helps, in the samples directory you'll find a small sample named 
Xdd that I included to demonstrate this part of the API.  In summary:

# list foo's named attributes
java Xdd foo

# set/replace an attribute value
java Xdd -set user.mimetype=text/html foo

# get an attribute value
java Xdd -get user.mimtype foo

# delete an attribute
java Xdd -del user.mimetype foo

You probably know this already but only NTFS supports ADS. I assume you 
will be testing this on other platforms too. On Linux you'll need to 
mount the file system with the user_xattr mount option to enable 
extended attributes. On Solaris then it will work for both ufs and zfz.

-Alan.



More information about the nio-discuss mailing list