TrueZIP Kernel 7.0-rc1

de.schlichtherle.truezip.fs
Class FsModel

java.lang.Object
  extended by de.schlichtherle.truezip.fs.FsModel
Direct Known Subclasses:
FsConcurrentModel

@ThreadSafe
@DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class)
public class FsModel
extends Object

Defines the common properties of a file system.

Author:
Christian Schlichtherle
See Also:
FsController

Field Summary
private  FsMountPoint mountPoint
           
private  FsModel parent
           
private  boolean touched
           
private  Set<FsTouchedListener> touchedListeners
           
 
Constructor Summary
FsModel(FsMountPoint mountPoint)
           
FsModel(FsMountPoint mountPoint, FsModel parent)
           
 
Method Summary
 void addFileSystemTouchedListener(FsTouchedListener listener)
          Adds the given listener to the set of file system touched listeners.
 boolean equals(Object that)
          Two file system models are considered equal if and only if their mount points are equal.
private static boolean equals(Object o1, Object o2)
           
(package private)  Set<FsTouchedListener> getFileSystemTouchedListeners()
          Returns a protective copy of the set of file system touched listeners.
 FsMountPoint getMountPoint()
          Returns the mount point of this file system model.
 FsModel getParent()
          Returns the model of the parent file system or null if and only if the file system is not federated, i.e. if it's not a member of a parent file system.
 int hashCode()
          Returns a hash code which is consistent with equals(java.lang.Object, java.lang.Object).
 boolean isTouched()
          Returns true if and only if the contents of the federated file system have been modified so that it needs synchronization with its parent file system.
 void removeFileSystemTouchedListener(FsTouchedListener listener)
          Removes the given listener from the set of file system touched listeners.
 void setTouched(boolean newTouched)
          Sets the value of the property touched to the new value and notifies all listeners if it has effectively changed.
 String toString()
          Returns a string representation of this object for debugging and logging purposes.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

mountPoint

private final FsMountPoint mountPoint

parent

@CheckForNull
private final FsModel parent

touched

private volatile boolean touched

touchedListeners

private Set<FsTouchedListener> touchedListeners
Constructor Detail

FsModel

public FsModel(FsMountPoint mountPoint)

FsModel

public FsModel(FsMountPoint mountPoint,
               @CheckForNull
               FsModel parent)
Method Detail

equals

private static boolean equals(@CheckForNull
                              Object o1,
                              @CheckForNull
                              Object o2)

getMountPoint

public final FsMountPoint getMountPoint()
Returns the mount point of this file system model.

The mount point may be used to construct error messages or to locate and access file system metadata which is stored outside the file system, e.g. in-memory stored passwords for RAES encrypted ZIP files.

Returns:
The mount point of this file system model.

getParent

@Nullable
public final FsModel getParent()
Returns the model of the parent file system or null if and only if the file system is not federated, i.e. if it's not a member of a parent file system.

Returns:
The nullable parent file system model.

isTouched

public final boolean isTouched()
Returns true if and only if the contents of the federated file system have been modified so that it needs synchronization with its parent file system.


setTouched

public final void setTouched(boolean newTouched)
Sets the value of the property touched to the new value and notifies all listeners if it has effectively changed.


getFileSystemTouchedListeners

final Set<FsTouchedListener> getFileSystemTouchedListeners()
Returns a protective copy of the set of file system touched listeners.

Returns:
A clone of the set of file system touched listeners.

addFileSystemTouchedListener

public final void addFileSystemTouchedListener(FsTouchedListener listener)
Adds the given listener to the set of file system touched listeners.

Parameters:
listener - the listener for file system touched events.

removeFileSystemTouchedListener

public final void removeFileSystemTouchedListener(@CheckForNull
                                                  FsTouchedListener listener)
Removes the given listener from the set of file system touched listeners.

Parameters:
listener - the listener for file system touched events.

equals

public final boolean equals(@CheckForNull
                            Object that)
Two file system models are considered equal if and only if their mount points are equal. This can't get overriden.

Overrides:
equals in class Object

hashCode

public final int hashCode()
Returns a hash code which is consistent with equals(java.lang.Object, java.lang.Object). This can't get overriden.

Overrides:
hashCode in class Object

toString

public final String toString()
Returns a string representation of this object for debugging and logging purposes.

Overrides:
toString in class Object

TrueZIP Kernel 7.0-rc1

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