TrueZIP Kernel 7.0-rc2

de.schlichtherle.truezip.fs
Enum FsSyncOption

java.lang.Object
  extended by java.lang.Enum<FsSyncOption>
      extended by de.schlichtherle.truezip.fs.FsSyncOption
All Implemented Interfaces:
Serializable, Comparable<FsSyncOption>

@Immutable
public enum FsSyncOption
extends Enum<FsSyncOption>

Defines the available options for the synchronization of federated file systems via the methods FsController.sync(de.schlichtherle.truezip.util.BitField) and FsManager.sync(de.schlichtherle.truezip.util.BitField).

Author:
Christian Schlichtherle

Enum Constant Summary
ABORT_CHANGES
          If this option is set, all pending changes are aborted.
CLEAR_CACHE
          Suppose a controller of a federated file system has cached entry data.
FORCE_CLOSE_INPUT
          Suppose there are any open input streams or read only files for any file system entries.
FORCE_CLOSE_OUTPUT
          Similar to FORCE_CLOSE_INPUT, but applies to file system entry output streams and may throw a OutputClosedException / OutputBusyException instead.
WAIT_CLOSE_INPUT
          Suppose there are any open input streams or read only files for any file system entries.
WAIT_CLOSE_OUTPUT
          Similar to WAIT_CLOSE_INPUT, but applies to file system entry output streams instead.
 
Method Summary
static FsSyncOption valueOf(String name)
          Returns the enum constant of this type with the specified name.
static FsSyncOption[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

WAIT_CLOSE_INPUT

public static final FsSyncOption WAIT_CLOSE_INPUT
Suppose there are any open input streams or read only files for any file system entries. Then if this option is set, the file system controller waits until all other threads have closed their entry input streams and read only files before proceeding with the update of the federated file system. Input streams and read only files opened by the current thread are always ignored. If the current thread gets interrupted while waiting, it will stop waiting and proceed normally as if this options wasn't set.

Beware: If a stream has not been closed because the client application does not always properly close its streams, even on an IOException (which is a typical bug in many Java applications), then the respective file system controller will not return from the update until the current thread gets interrupted!


FORCE_CLOSE_INPUT

public static final FsSyncOption FORCE_CLOSE_INPUT
Suppose there are any open input streams or read only files for any file system entries. Then if this option is set, the file system controller will proceed to update the federated file system anyway and finally throw a FsSyncWarningException with a InputBusyException as its cause to indicate that any subsequent operations on these streams will fail with an InputClosedException because they have been forced to close.

If this option is not set, the federated file system is not updated and an InputBusyException is thrown to indicate that the application must close all entry input streams and read only files first.


WAIT_CLOSE_OUTPUT

public static final FsSyncOption WAIT_CLOSE_OUTPUT
Similar to WAIT_CLOSE_INPUT, but applies to file system entry output streams instead.


FORCE_CLOSE_OUTPUT

public static final FsSyncOption FORCE_CLOSE_OUTPUT
Similar to FORCE_CLOSE_INPUT, but applies to file system entry output streams and may throw a OutputClosedException / OutputBusyException instead.

If this option is set, then FORCE_CLOSE_INPUT must be set, too. Otherwise, an IllegalArgumentException is thrown.


ABORT_CHANGES

public static final FsSyncOption ABORT_CHANGES
If this option is set, all pending changes are aborted. This option may leave the federated file system corrupted and is only meaningful immediately before the federated file system gets deleted.


CLEAR_CACHE

public static final FsSyncOption CLEAR_CACHE
Suppose a controller of a federated file system has cached entry data. Then if this option is set, the cached entry data get cleared after flushing it to the file system when it gets synchronized.

Method Detail

values

public static FsSyncOption[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (FsSyncOption c : FsSyncOption.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static FsSyncOption valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

TrueZIP Kernel 7.0-rc2

Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.