org.mockftpserver.fake.filesystem
Class AbstractFileSystemEntry

java.lang.Object
  extended by org.mockftpserver.fake.filesystem.AbstractFileSystemEntry
All Implemented Interfaces:
FileSystemEntry
Direct Known Subclasses:
DirectoryEntry, FileEntry

public abstract class AbstractFileSystemEntry
extends Object
implements FileSystemEntry

The abstract superclass for concrete file system entry classes representing files and directories.

Version:
$Revision: 182 $ - $Date: 2008-11-30 21:37:49 -0500 (Sun, 30 Nov 2008) $
Author:
Chris Mair

Constructor Summary
AbstractFileSystemEntry()
          Construct a new instance without setting its path
AbstractFileSystemEntry(String path)
          Construct a new instance with the specified value for its path
 
Method Summary
 String getGroup()
           
 Date getLastModified()
          Return the timestamp Date for the last modification of this file system entry
 String getName()
          Return the file name or directory name (no path) for this entry
 String getOwner()
           
 String getPath()
          Return the path for this file system entry
 Permissions getPermissions()
           
abstract  boolean isDirectory()
          Abstract method -- must be implemented within concrete subclasses
 void lockPath()
          Lock down the path so it cannot be changed
 void setGroup(String group)
           
 void setLastModified(Date lastModified)
          Set the timestamp Date for the last modification of this file system entry
 void setOwner(String owner)
           
 void setPath(String path)
          Set the path for this entry.
 void setPermissions(Permissions permissions)
           
 void setPermissionsFromString(String permissionsString)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mockftpserver.fake.filesystem.FileSystemEntry
cloneWithNewPath, getSize
 

Constructor Detail

AbstractFileSystemEntry

public AbstractFileSystemEntry()
Construct a new instance without setting its path


AbstractFileSystemEntry

public AbstractFileSystemEntry(String path)
Construct a new instance with the specified value for its path

Parameters:
path - - the value for path
Method Detail

getLastModified

public Date getLastModified()
Description copied from interface: FileSystemEntry
Return the timestamp Date for the last modification of this file system entry

Specified by:
getLastModified in interface FileSystemEntry
Returns:
the last modified timestamp Date for this file system entry

setLastModified

public void setLastModified(Date lastModified)
Description copied from interface: FileSystemEntry
Set the timestamp Date for the last modification of this file system entry

Specified by:
setLastModified in interface FileSystemEntry
Parameters:
lastModified - - the lastModified value, as a Date

getOwner

public String getOwner()
Specified by:
getOwner in interface FileSystemEntry
Returns:
the username of the owner of this file system entry

setOwner

public void setOwner(String owner)

getGroup

public String getGroup()
Specified by:
getGroup in interface FileSystemEntry
Returns:
the name of the owning group for this file system entry

setGroup

public void setGroup(String group)

getPermissions

public Permissions getPermissions()
Specified by:
getPermissions in interface FileSystemEntry
Returns:
the Permissions for this file system entry

setPermissions

public void setPermissions(Permissions permissions)

getPath

public String getPath()
Description copied from interface: FileSystemEntry
Return the path for this file system entry

Specified by:
getPath in interface FileSystemEntry
Returns:
the path for this entry

getName

public String getName()
Description copied from interface: FileSystemEntry
Return the file name or directory name (no path) for this entry

Specified by:
getName in interface FileSystemEntry
Returns:
the file name or directory name (no path) for this entry

setPath

public void setPath(String path)
Set the path for this entry. Throw an exception if pathLocked is true.

Parameters:
path - - the new path value

lockPath

public void lockPath()
Description copied from interface: FileSystemEntry
Lock down the path so it cannot be changed

Specified by:
lockPath in interface FileSystemEntry

setPermissionsFromString

public void setPermissionsFromString(String permissionsString)

isDirectory

public abstract boolean isDirectory()
Abstract method -- must be implemented within concrete subclasses

Specified by:
isDirectory in interface FileSystemEntry
Returns:
true if this file system entry represents a directory


Copyright © 2014. All rights reserved.