[jcifs] setReadOnly, setReadWrite, or setAttributes?

Michael B Allen mba2000 at ioplex.com
Wed Oct 29 16:15:12 EST 2003

>> 3) Implement a more advanced set/getAttributes API such as:
>> static final int ATTR_ARCHIVE    = 0x020;
>> static final int ATTR_COMPRESSED = 0x800;
>> static final int ATTR_NORMAL     = 0x080;
>> static final int ATTR_HIDDEN     = 0x002;
>> static final int ATTR_READONLY   = 0x001;
>> static final int ATTR_TEMPORARY  = 0x100;
>> static final int ATTR_DIRECTORY  = 0x010;
>> static final int ATTR_SYSTEM     = 0x004;
>> public int getAttributes() throws SmbException;
>> public void setAttributes( int attrs ) throws SmbException;
>> Any opinions?
> I am a fan of completeness.

Yeah, I'm going with case 3 but I will also provide
setReadOnly/setReadWrite convenience methods for clueless types (see - I'm

> Note, though, that these shoul have names like FAT_ATTR_ARCHIVE.  The NTFS
> filesystem offers a completely different set of attributes, extended
> attributes, ACE's, etc.  The protocol is tuned to provide support for both
> FAT and NTFS semantics.

Huh? NTFS has these attributes. I don't know how they're implemented but
from the protocol view they're exactly the same.

Extended attributes will need some more thought but I'm not sure if I'm
ready to tackle them this time around :(


A program should be written to  model the concepts of the task it
performs rather than the physical world or a process because this
maximizes the  potential for it  to be applied  to tasks that are
conceptually similar and, more  important, to tasks that have not
yet been conceived.

More information about the jcifs mailing list