org.entityfs.cap.entityattrs.unix
Class UnixAttributes

java.lang.Object
  extended by org.entityfs.cap.entityattrs.unix.UnixAttributes
All Implemented Interfaces:
Cloneable, CreationTimeAttributes, EntityAttributes, UidGidAttributes, UnixEntityModeAttributes, CreationTimeConfigurable, UidGidConfigurable, UnixEntityModeConfigurable

public class UnixAttributes
extends Object
implements UnixEntityModeAttributes, CreationTimeAttributes, UidGidAttributes

This object contains attributes that a file in a Unix file system can have.

Read more about entity attributes in the ECEntityAttributes documentation.

Since:
1.0
Author:
Karl Gustafsson
See Also:
ECUnixAttributes
In_jar:
entityfs-entity_attributes

Constructor Summary
UnixAttributes()
           
 
Method Summary
 Object clone()
          The Cloneable interface does not make the clone() method visible.
 boolean equals(Object o)
           
 boolean equalsExceptForCreationTime(Object o)
          Check if this attribute object is equal to the supplied object except for the creation time.
 long getCreationTime()
          Get the creation time of the entity.
 int getGid()
          Get the group id.
 int getUid()
          Get the user id.
 UnixEntityMode getUnixEntityMode()
          Get the current UnixEntityMode.
 int hashCode()
           
 void setCreationTime(long creationTime)
          Set the creation time of the entity in milliseconds since January 1, 1970
 void setGid(int gid)
          Set the group id.
 void setUid(int uid)
          Set the user id.
 void setUnixEntityMode(int m)
          Set the UnixEntityMode using its integer representation.
 void setUnixEntityMode(UnixEntityMode unixEntityMode)
          Set the UnixEntityMode.
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnixAttributes

public UnixAttributes()
Method Detail

getCreationTime

public long getCreationTime()
Description copied from interface: CreationTimeConfigurable
Get the creation time of the entity.

Specified by:
getCreationTime in interface CreationTimeConfigurable
Returns:
The entity's creation time in milliseconds since January 1st, 1970.
See Also:
Date.getTime()

setCreationTime

public void setCreationTime(long creationTime)
Description copied from interface: CreationTimeConfigurable
Set the creation time of the entity in milliseconds since January 1, 1970

Specified by:
setCreationTime in interface CreationTimeConfigurable
Parameters:
creationTime - The new creation time.
See Also:
Date.getTime()

getGid

public int getGid()
Description copied from interface: UidGidConfigurable
Get the group id.

Specified by:
getGid in interface UidGidConfigurable
Returns:
The group id.

setGid

public void setGid(int gid)
            throws IllegalArgumentException
Description copied from interface: UidGidConfigurable
Set the group id.

Specified by:
setGid in interface UidGidConfigurable
Parameters:
gid - The group id. It must be a positive integer.
Throws:
IllegalArgumentException - If the GID is invalid.

getUid

public int getUid()
Description copied from interface: UidGidConfigurable
Get the user id.

Specified by:
getUid in interface UidGidConfigurable
Returns:
The user id.

setUid

public void setUid(int uid)
            throws IllegalArgumentException
Description copied from interface: UidGidConfigurable
Set the user id.

Specified by:
setUid in interface UidGidConfigurable
Parameters:
uid - The user id. It must be a positive integer.
Throws:
IllegalArgumentException - If the UID is invalid.

getUnixEntityMode

public UnixEntityMode getUnixEntityMode()
Description copied from interface: UnixEntityModeConfigurable
Get the current UnixEntityMode.

Specified by:
getUnixEntityMode in interface UnixEntityModeConfigurable
Returns:
The current UnixEntityMode.

setUnixEntityMode

public void setUnixEntityMode(UnixEntityMode unixEntityMode)
Description copied from interface: UnixEntityModeConfigurable
Set the UnixEntityMode.

Specified by:
setUnixEntityMode in interface UnixEntityModeConfigurable
Parameters:
unixEntityMode - The new UnixEntityMode.
See Also:
UnixEntityModeConfigurable.setUnixEntityMode(int)

setUnixEntityMode

public void setUnixEntityMode(int m)
Description copied from interface: UnixEntityModeConfigurable
Set the UnixEntityMode using its integer representation.

Specified by:
setUnixEntityMode in interface UnixEntityModeConfigurable
Parameters:
m - An integer representing the mode, for instance 0644 or 01777.
See Also:
UnixEntityModeConfigurable.setUnixEntityMode(UnixEntityMode)

equalsExceptForCreationTime

public boolean equalsExceptForCreationTime(Object o)
Description copied from interface: CreationTimeAttributes
Check if this attribute object is equal to the supplied object except for the creation time.

Specified by:
equalsExceptForCreationTime in interface CreationTimeAttributes
Parameters:
o - The other attribute object.
Returns:
true if the attribute objects are equals in all attributes except for the creation time.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

clone

public Object clone()
Description copied from interface: EntityAttributes
The Cloneable interface does not make the clone() method visible. This declaration does.

Specified by:
clone in interface EntityAttributes
Overrides:
clone in class Object
Returns:
A clone of this object.
See Also:
Cloneable

toString

public String toString()
Overrides:
toString in class Object