public class Automounter
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
Automounter.RegistryEntry |
| Modifier and Type | Field and Description |
|---|---|
private static java.util.concurrent.ConcurrentMap<MountOwner,java.util.Set<Automounter.RegistryEntry>> |
ownerReferences |
private static Automounter.RegistryEntry |
rootEntry |
private static TempFileProvider |
tempFileProvider |
| Modifier | Constructor and Description |
|---|---|
private |
Automounter()
Private constructor
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
addHandle(VirtualFile owner,
java.io.Closeable handle)
Add handle to owner, to be auto closed.
|
static void |
cleanup(MountOwner owner)
Cleanup all references from the
MountOwner. |
static void |
cleanup(java.lang.Object owner)
Cleanup all references from the owner.
|
static void |
cleanup(VirtualFile owner)
Cleanup all references from the owner.
|
(package private) static Automounter.RegistryEntry |
getEntry(VirtualFile virtualFile)
Get the entry from the tree creating the entry if not present.
|
private static MountConfig |
getMountConfig(MountOption[] mountOptions)
Creates a MountConfig and applies the provided mount options
|
private static TempFileProvider |
getTempFileProvider() |
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(java.lang.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,
java.io.Closeable handle)
Remove handle from owner.
|
private static final Automounter.RegistryEntry rootEntry
private static final java.util.concurrent.ConcurrentMap<MountOwner,java.util.Set<Automounter.RegistryEntry>> ownerReferences
private static TempFileProvider tempFileProvider
public static void mount(VirtualFile target, MountOption... mountOptions) throws java.io.IOException
VirtualFile (if not mounted) and set the owner to be the provided target. (Self owned mount)target - VirtualFile to mountmountOptions - optional configuration to use for mountingjava.io.IOException - when the target can not be mounted.public static void mount(java.lang.Object owner,
VirtualFile target,
MountOption... mountOptions)
throws java.io.IOException
VirtualFile (if not mounted) and add an owner entry. Also creates a back-reference to from the owner to the target.owner - Object that owns the reference to the mounttarget - VirtualFile to mountmountOptions - optional configuration to use for mountingjava.io.IOException - when the target can not be mounted.public static void mount(VirtualFile owner, VirtualFile target, MountOption... mountOptions) throws java.io.IOException
VirtualFile (if not mounted) and add an owner entry. Also creates a back-reference to from the owner to the target.owner - VirtualFile that owns the reference to the mounttarget - VirtualFile to mountmountOptions - optional configuration to use for mountingjava.io.IOException - when the target can not be mounted.public static void mount(MountOwner owner, VirtualFile target, MountOption... mountOptions) throws java.io.IOException
VirtualFile (if not mounted) and add an owner entry. Also creates a back-reference to from the owner to the target.owner - MountOwner that owns the reference to the mounttarget - VirtualFile to mountmountOptions - optional configuration to use for mountingjava.io.IOException - when the target can not be mountedprivate static MountConfig getMountConfig(MountOption[] mountOptions)
mountOptions - options to use for mountingpublic static boolean addHandle(VirtualFile owner, java.io.Closeable handle)
owner - the handle ownerhandle - the handlepublic static boolean removeHandle(VirtualFile owner, java.io.Closeable handle)
owner - the handle ownerhandle - the handlepublic static void cleanup(java.lang.Object owner)
owner - Object to cleanup references forpublic static void cleanup(VirtualFile owner)
owner - Object to cleanup references forpublic static void cleanup(MountOwner owner)
MountOwner. Cleanup any mounted entries that become un-referenced in the process.owner - MountOwner to cleanup references forpublic static boolean isMounted(VirtualFile target)
VirtualFile is mounted.target - target to checkstatic Automounter.RegistryEntry getEntry(VirtualFile virtualFile)
virtualFile - entry's owner fileprivate static TempFileProvider getTempFileProvider() throws java.io.IOException
java.io.IOException