[jcifs] Looking for some information on creating, deleting, listing, etc. "shares" from java in an OS platform independent manner.

Michael B Allen ioplex at gmail.com
Mon Mar 22 19:29:29 MDT 2010

Hi mr.malibu,

Indeed JCIFS does not contain the code necessary to create, delete and
rename shares. However the implementation of these routines should be
fairly straight forward. You would need to track down the IDL
(NetrShareCreate?), add it to the correct idl file (samr.idl?), run
the midlc program on it and then add some logic to SmbFile
createNewFile (?), delete, renameTo, etc. The work is non-trival as it
requires some basic knowledge of MS-RPC and some research but I'm not
aware of any show stoppers.

Manipulating permissions on shares (or files) is more complicated as
it requires composing security descriptors. Currently JCIFS can read
and expose the contents of security descriptors but it cannot write


Michael B Allen
Java Active Directory Integration

On Mon, Mar 22, 2010 at 2:31 PM, mr.malibu <mr.malibu at gmail.com> wrote:
> Hi Guys,
> Looking for some information on creating, deleting, listing, etc. "shares" from
> java in an OS platform independent manner.
> #1 My team is developing a java application and we need to be able to
> create/delete and list shares on users machine/account. This application will
> run on a variety of Operating Systems including Windows and Linux. Ideally there
> would be an open source OS Independent library/API that would allow us to
> implement these features but to date, we not discovered any. We are however
> using JCIFS to accomplish some of these tasks, however, jCIFS does not provide
> the abililty to create or delete shares.
> #2 As an alternative, we've been researching platform specific techniques for
> creating, deleting, listing, etc. existing shares and that is where the 'net
> share add', 'net share delete' etc commands come into play.
> #3 We've investigated a few different approaches and found that the 'net share
> add', 'net share delete', etc. commands are available on all the OS platforms
> we're looking at (Windows, Mac, Linux) and thus their use seem like a good way
> to go.
> So, the bottom line is that some kind of a cross platform open source JAVA
> library that allows one to CRUD (Create, Read, Update, Delete) shares, control
> their permissions, etc. would be of the highest value followed any STANDARD OS
> platform specific means.
> Thanks again for your comments and feedback, however, now that you've got a more
> complete picture of our needs, we'd like to hear them.

More information about the jCIFS mailing list