com.radinks.net
Class RemoteFile

java.lang.Object
  extended bycom.radinks.net.RemoteFile
Direct Known Subclasses:
MSRemoteFile, UnixRemoteFile

public class RemoteFile
extends java.lang.Object

Represents a file on the remote server, two subclasses provide functionality specific to files on windows and unix like operating systems. Other platforms are not supported at the moment.

The correct way to make use of this class is to create a new instance by calling the parse() method, which is a factory.


Constructor Summary
protected RemoteFile()
           
protected RemoteFile(java.lang.String s)
           
 
Method Summary
static RemoteFile doubleDot()
          Create an entry for the parent folder.
 FileAttrs getAttrs()
           
 java.lang.String getFilename()
           
static boolean isRedmond()
           
static RemoteFile parse(java.lang.String s)
          A factory method that creates a remote file instanace for the current server type.
 void setAttrs(FileAttrs attrs)
           
 void setFileName(java.lang.String fileName)
           
static void setServerType(java.lang.String st)
          Are we running on windows or linux?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteFile

protected RemoteFile()

RemoteFile

protected RemoteFile(java.lang.String s)
Method Detail

parse

public static RemoteFile parse(java.lang.String s)
A factory method that creates a remote file instanace for the current server type.

Parameters:
s - a line read in from the LIST command.
Returns:
an instance of a RemoteFile subclass.

doubleDot

public static RemoteFile doubleDot()
Create an entry for the parent folder. The ftp server maynot return a '..' entry, in that case we have to create one, however doing a ls ../.. is not always a good idea so we hack together a filename.

Returns:
an object that corresponds to the parent folder of the current working directory.

getFilename

public java.lang.String getFilename()
Returns:
this file's name

getAttrs

public FileAttrs getAttrs()
Returns:
attributes for this file.

setServerType

public static void setServerType(java.lang.String st)
Are we running on windows or linux?

Parameters:
st -

isRedmond

public static boolean isRedmond()
Returns:
true if the server is running on that lousy operating system.

setAttrs

public void setAttrs(FileAttrs attrs)
Parameters:
attrs - attributes for this file.

setFileName

public void setFileName(java.lang.String fileName)
Parameters:
fileName - name of this file.


Rad Inks FTP library
Copyright (c) 2003,2004 Rad Inks (Pvt) Ltd.