[jcifs] JCIFS Client properties

Michael B Allen ioplex at gmail.com
Tue Aug 18 10:04:39 MDT 2009

On Mon, Aug 17, 2009 at 6:04 PM, marasim<marasim at gmail.com> wrote:
> I was reading through the Client properties page
> (http://jcifs.samba.org/src/docs/api/overview-summary.html#scp) and had some
> question/concern:
> 1. Are multiple JCIFS clients in the same JVM
> supproted/recommended/possible?

JCIFS automatically creates multiple transports as necessary to
satisfy whatever SmbFile operations there may be. There is no single
handle to a "client" so this question doesn't really make sense.

> 2. What if I have multiple clients in the same JVM and they have a different
> value of the same client property? Will this result in setting that property
> from the first client that requests it or the last or something else will
> happen.

All JCIFS properties are global and static so you cannot change JCIFS
properties at runtime at all (or at least you should not). The best
way to set JCIFS properties is with a properties file with
-Djcifs.properties=file.prp on the JVM commandline.

Note that all JCIFS properties are for things that are also global and
static on other CIFS platforms so the fact that JCIFS properties are
global and static should not be a problem. For example, the
LmCompatibilityLevel is set in the registry on a Windows system and
thus it is global and static just like corresponding
jcifs.smb.lmCompatibility property.

If you want to have multiple separate instances of JCIFS with
different properties, you can load them using separate class loaders.

> 3. Is there a master client property to suggest which client should take a
> lead in this case or is there a way to specify it.
> 4. I plan on running multiple instances of the same client so it is not
> possible to use the property in one client and not in another.

Again, there is no singular "client" because JCIFS uses an
java.io.File interface so these questions do not really make sense.

All properties are global but because they correspond to things that
are global on other platforms like Windows, even if you could create
"multiple instances" of something, you should not need to use
different values for these properties.


Michael B Allen
Java Active Directory Integration

More information about the jCIFS mailing list