com.glub.secureftp.bean
Class RemoteFile

java.lang.Object
  extended by com.glub.secureftp.bean.RemoteFile
All Implemented Interfaces:
Serializable

public class RemoteFile
extends Object
implements Serializable

The RemoteFile class is an abstract representation of a file on the FTP server.

Since:
2.1.3
Version:
$Revision: 47 $, $Date: 2009-05-16 10:10:12 -0700 (Sat, 16 May 2009) $
See Also:
Serialized Form

Constructor Summary
RemoteFile()
          Create an empty RemoteFile object.
RemoteFile(String fileName)
          Create a RemoteFile object.
RemoteFile(String permissions, int linkCount, String user, String group, long fileSize, Calendar date, String fileName, String fullLine)
          Create a RemoteFile object.
 
Method Summary
 String getAlias()
          Get the alias name of the remote file.
 Calendar getDate()
          Get the modification date of the remote file.
 String getFileName()
          Get the file name of the remote file.
 long getFileSize()
          Get the file size of the remote file.
 String getFullLine()
          Get the full (unparsed) line listing from the FTP server.
 String getGroup()
          Get the group owner of the remote file.
 int getLinkCount()
          Get the link (or reference) count of the remote file.
 Object getMetaData(Object key)
          Get stored metadata.
 String getPermissions()
          Get the permissions of the remote file.
 String getUser()
          Get the user owner of the remote file.
 boolean isBlockSpecial()
          Is this file a block special file?
 boolean isCharSpecial()
          Is this file a character special file?
 boolean isDirectory()
          Is this file a directory?
 boolean isDoor()
          Is this file a door?
 boolean isFile()
          Is this file an ordinary file?
 boolean isKnownFileType()
          Is this a known file type?
 boolean isLink()
          Is this file a symbolic link?
 boolean isPipe()
          Is this file a pipe?
 boolean isSocket()
          Is this file a socket?
 void setAlias(String alias)
          Set the alias name of the remote file.
 void setDate(Calendar date)
          Set the modification date of the remote file.
 void setFileName(String fileName)
          Set the file name of the remote file.
 void setFileSize(long fileSize)
          Set the file size of the remote file.
 void setFullLine(String fullLine)
          Set the full (unparsed) line listing from the FTP server.
 void setGroup(String group)
          Set the group owner of the remote file.
 void setLinkCount(int linkCount)
          Set the link (or reference) count of the remote file.
 void setMetaData(Object key, Object value)
          A place to store your own metadata.
 void setPermissions(String permissions)
          Set the permissions of the remote file.
 void setUser(String user)
          Set the user owner of the remote file.
 String toString()
          Simple display of remote file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RemoteFile

public RemoteFile()
Create an empty RemoteFile object.


RemoteFile

public RemoteFile(String fileName)
Create a RemoteFile object.

Parameters:
fileName - the name of the remote file.

RemoteFile

public RemoteFile(String permissions,
                  int linkCount,
                  String user,
                  String group,
                  long fileSize,
                  Calendar date,
                  String fileName,
                  String fullLine)
Create a RemoteFile object.

Parameters:
permissions - the permissions of the remote file.
linkCount - the reference count of the remote file.
user - the user owner of the remote file.
group - the group owner of the remote file.
fileSize - the size of the remote file.
date - the modification date of the remote file.
fileName - the name of the remote file.
fullLine - the (unparsed) line as returned from the server.
Method Detail

toString

public String toString()
Simple display of remote file.

Overrides:
toString in class Object
Returns:
the remote file as a String.

getPermissions

public String getPermissions()
Get the permissions of the remote file.

Returns:
the permissions.

setPermissions

public void setPermissions(String permissions)
Set the permissions of the remote file.

Parameters:
permissions - the permissions.

getLinkCount

public int getLinkCount()
Get the link (or reference) count of the remote file.

Returns:
the link count.

setLinkCount

public void setLinkCount(int linkCount)
Set the link (or reference) count of the remote file.

Parameters:
linkCount - the link count.

getUser

public String getUser()
Get the user owner of the remote file.

Returns:
the user owner.

setUser

public void setUser(String user)
Set the user owner of the remote file.

Parameters:
user - the user owner.

getGroup

public String getGroup()
Get the group owner of the remote file.

Returns:
the group owner.

setGroup

public void setGroup(String group)
Set the group owner of the remote file.

Parameters:
group - the user owner.

getFileSize

public long getFileSize()
Get the file size of the remote file.

Note: if the fileSize == -1, the other metadata may be inaccurate.

Returns:
the file size owner.

setFileSize

public void setFileSize(long fileSize)
Set the file size of the remote file.

Parameters:
fileSize - the size of the file.

getDate

public Calendar getDate()
Get the modification date of the remote file.

Returns:
the modification date.

setDate

public void setDate(Calendar date)
Set the modification date of the remote file.

Parameters:
date - the modification date.

getFileName

public String getFileName()
Get the file name of the remote file.

Returns:
the file name.

setFileName

public void setFileName(String fileName)
Set the file name of the remote file.

Parameters:
fileName - the file name.

getAlias

public String getAlias()
Get the alias name of the remote file.

Returns:
the alias name.

setAlias

public void setAlias(String alias)
Set the alias name of the remote file.

Parameters:
alias - the name of the alias.

getFullLine

public String getFullLine()
Get the full (unparsed) line listing from the FTP server.

Returns:
the full (unparsed) line.

setFullLine

public void setFullLine(String fullLine)
Set the full (unparsed) line listing from the FTP server.

Parameters:
fullLine - the full (unparsed) line.

setMetaData

public void setMetaData(Object key,
                        Object value)
A place to store your own metadata.


getMetaData

public Object getMetaData(Object key)
Get stored metadata.

Returns:
stored matadata.

isKnownFileType

public boolean isKnownFileType()
Is this a known file type?

Returns:
true if file type was parsed.

isDirectory

public boolean isDirectory()
Is this file a directory?

Returns:
true if a directory.

isDoor

public boolean isDoor()
Is this file a door?

Returns:
true if a door.

isLink

public boolean isLink()
Is this file a symbolic link?

Returns:
true if a symbolic link.

isBlockSpecial

public boolean isBlockSpecial()
Is this file a block special file?

Returns:
true if a block special file.

isCharSpecial

public boolean isCharSpecial()
Is this file a character special file?

Returns:
true if a character special file.

isPipe

public boolean isPipe()
Is this file a pipe?

Returns:
true if a pipe.

isSocket

public boolean isSocket()
Is this file a socket?

Returns:
true if a socket.

isFile

public boolean isFile()
Is this file an ordinary file?

Returns:
true if an ordinary file?


Copyright © 2000-08 Glub Tech, Inc. All Rights Reserved.