JBoss VFS 3.0.1.GA

org.jboss.vfs.util.automount
Class Automounter

java.lang.Object
  extended by org.jboss.vfs.util.automount.Automounter

public class Automounter
extends Object

Utility used to manage mounting Virtual FileSystems.

Author:
John Bailey

Method Summary
static boolean addHandle(VirtualFile owner, Closeable handle)
          Add handle to owner, to be auto closed.
static void cleanup(MountOwner owner)
          Cleanup all references from the MountOwner.
static void cleanup(Object owner)
          Cleanup all references from the owner.
static void cleanup(VirtualFile owner)
          Cleanup all references from the owner.
static boolean isMounted(VirtualFile target)
          Determines whether a target VirtualFile is mounted.
static void mount(MountOwner owner, VirtualFile target, MountOption... mountOptions)
          Mount provided VirtualFile (if not mounted) and add an owner entry.
static void mount(Object owner, VirtualFile target, MountOption... mountOptions)
          Mount provided VirtualFile (if not mounted) and add an owner entry.
static void mount(VirtualFile target, MountOption... mountOptions)
          Mount provided VirtualFile (if not mounted) and set the owner to be the provided target.
static void mount(VirtualFile owner, VirtualFile target, MountOption... mountOptions)
          Mount provided VirtualFile (if not mounted) and add an owner entry.
static boolean removeHandle(VirtualFile owner, Closeable handle)
          Remove handle from owner.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

mount

public static void mount(VirtualFile target,
                         MountOption... mountOptions)
                  throws IOException
Mount provided VirtualFile (if not mounted) and set the owner to be the provided target. (Self owned mount)

Parameters:
target - VirtualFile to mount
mountOptions - optional configuration to use for mounting
Throws:
IOException - when the target can not be mounted.

mount

public static void mount(Object owner,
                         VirtualFile target,
                         MountOption... mountOptions)
                  throws IOException
Mount provided VirtualFile (if not mounted) and add an owner entry. Also creates a back-reference to from the owner to the target.

Parameters:
owner - Object that owns the reference to the mount
target - VirtualFile to mount
mountOptions - optional configuration to use for mounting
Throws:
IOException - when the target can not be mounted.

mount

public static void mount(VirtualFile owner,
                         VirtualFile target,
                         MountOption... mountOptions)
                  throws IOException
Mount provided VirtualFile (if not mounted) and add an owner entry. Also creates a back-reference to from the owner to the target.

Parameters:
owner - VirtualFile that owns the reference to the mount
target - VirtualFile to mount
mountOptions - optional configuration to use for mounting
Throws:
IOException - when the target can not be mounted.

mount

public static void mount(MountOwner owner,
                         VirtualFile target,
                         MountOption... mountOptions)
                  throws IOException
Mount provided VirtualFile (if not mounted) and add an owner entry. Also creates a back-reference to from the owner to the target.

Parameters:
owner - MountOwner that owns the reference to the mount
target - VirtualFile to mount
mountOptions - optional configuration to use for mounting
Throws:
IOException - when the target can not be mounted

addHandle

public static boolean addHandle(VirtualFile owner,
                                Closeable handle)
Add handle to owner, to be auto closed.

Parameters:
owner - the handle owner
handle - the handle
Returns:
add result

removeHandle

public static boolean removeHandle(VirtualFile owner,
                                   Closeable handle)
Remove handle from owner.

Parameters:
owner - the handle owner
handle - the handle
Returns:
remove result

cleanup

public static void cleanup(Object owner)
Cleanup all references from the owner. Cleanup any mounted entries that become un-referenced in the process.

Parameters:
owner - Object to cleanup references for

cleanup

public static void cleanup(VirtualFile owner)
Cleanup all references from the owner. Cleanup any mounted entries that become un-referenced in the process.

Parameters:
owner - Object to cleanup references for

cleanup

public static void cleanup(MountOwner owner)
Cleanup all references from the MountOwner. Cleanup any mounted entries that become un-referenced in the process.

Parameters:
owner - MountOwner to cleanup references for

isMounted

public static boolean isMounted(VirtualFile target)
Determines whether a target VirtualFile is mounted.

Parameters:
target - target to check
Returns:
true if mounted, false otherwise

JBoss VFS 3.0.1.GA

Copyright © 2011 JBoss, A division of Red Hat, Inc. All Rights Reserved.