public class FileSystemUtil extends Object
Constructor and Description |
---|
FileSystemUtil() |
Modifier and Type | Method and Description |
---|---|
static ReadWriteLock |
acquireFileLock(File file)
Acquires the lock object for the given file.
|
static boolean |
deleteLocalFile(File file)
Deletes a file locally.
|
static void |
disposeFileLock(File file)
Disposes the use of a lock for a file.
|
static ReadWriteLock |
getFileLock(File file)
Returns the lock object of a file, if it currently exists.
|
static boolean |
isStandardFileSystem()
Returns whether the used file system is a LumisPortal standard one.
|
static <T extends Serializable> |
sendClusterCommand(IClusterCallable<T> callable)
Utility method that sends the given callable as a durable, total order cluster command.
|
static void |
sendClusterCommand(Runnable runnable)
Utility method that sends the given runnable as a durable, total order
cluster command.
|
public static ReadWriteLock acquireFileLock(File file)
disposeFileLock(File)
after using the lock (that should be
unlocked). A try/finally block should be used to guarantee the disposal.file
- the file.public static ReadWriteLock getFileLock(File file)
file
- the file.null
if it is not currently
acquired.acquireFileLock(File)
public static void disposeFileLock(File file)
file
- the file.acquireFileLock(File)
public static boolean deleteLocalFile(File file)
file
- the file.public static void sendClusterCommand(Runnable runnable)
runnable
- the runnable.public static <T extends Serializable> T sendClusterCommand(IClusterCallable<T> callable) throws Exception
callable
- the callable.Exception
public static boolean isStandardFileSystem()
Lumisportal 10.1.2.170428 - Copyright © 2006–2017 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.