All Packages  This Package  Class Hierarchy  Class Search  Index

Class kh.net.FtpFile
java.lang.Object
   |
   +----kh.net.FtpFile

  Summary

public class  FtpFile
     extends java.lang.Object
     implements kh.io.FileInfo
{
          // Constructors 1
     public FtpFile(FtpFile, String) throws IOException;

          // Methods 16
     public FileInfo createChild(String, boolean) throws IOException;
     public void deleteFile() throws IOException;
     public FileInfo getChild(String) throws IOException;
     public Enumeration getChildren() throws IOException;
     public String getFullPath();
     public long getLength();
     public Date getModDate();
     public String getName();
     public FileInfo getParentInfo();
     public boolean isDirectory();
     public boolean isFile();
     public boolean isWritable();
     public InputStream openInputStream() throws IOException;
     public OutputStream openOutputStream() throws IOException;
     public void renameFile(FileInfo) throws IOException;
     public String toString();
}

This class provides an interface to files on the other side of an FTP link


  Cross Reference

Returned By:
FtpClient.getCWD()





  Constructors

· FtpFile

Summary  |  Top
   public FtpFile(FtpFile parent, 
                  String name)  throws IOException

Create a FileInfo with this FileInfo as the parent. No file is actually created at this point



  Methods

· createChild

Summary  |  Top
   public FileInfo createChild(String name, 
                               boolean isDirectory)  throws IOException

Create a FileInfo with this FileInfo as the parent. The file is not yet created unless it is a directory. If not a directory, the file is created by openOutputStream.

Implements:
createChild in interface FileInfo


· deleteFile

Summary  |  Top
   public void deleteFile()  throws IOException

Delete the specified file.

Implements:
deleteFile in interface FileInfo


· getChild

Summary  |  Top
   public FileInfo getChild(String name)  throws IOException

Return a FileInfo which references a preexisting file or directory. Throws an exception if the file doesn't exist

Implements:
getChild in interface FileInfo


· getChildren

Summary  |  Top
   public Enumeration getChildren()  throws IOException

Returns:
an Enumeration of FtpFile containing current directory contents
Implements:
getChildren in interface FileInfo


· getFullPath

Summary  |  Top
   public String getFullPath() 

Return the full recursive pathname for this node



· getLength

Summary  |  Top
   public long getLength() 

Return the number of bytes in this file

Implements:
getLength in interface FileInfo


· getModDate

Summary  |  Top
   public Date getModDate() 

Return the mod date for this file

Implements:
getModDate in interface FileInfo


· getName

Summary  |  Top
   public String getName() 

Return the name of this file

Implements:
getName in interface FileInfo


· getParentInfo

Summary  |  Top
   public FileInfo getParentInfo() 

Return the parent directory of this file - or null if we were the root node

Implements:
getParentInfo in interface FileInfo


· isDirectory

Summary  |  Top
   public boolean isDirectory() 

Return true if this is a directory

Implements:
isDirectory in interface FileInfo


· isFile

Summary  |  Top
   public boolean isFile() 

Return true if a 'regular' file

Implements:
isFile in interface FileInfo


· isWritable

Summary  |  Top
   public boolean isWritable() 

Return true if this file can be written to by the current user

Implements:
isWritable in interface FileInfo


· openInputStream

Summary  |  Top
   public InputStream openInputStream()  throws IOException

Return a stream which can be used to read from this file. The caller is responsible closing the stream eventually. Throws an exception if this is not isFile().

Implements:
openInputStream in interface FileInfo


· openOutputStream

Summary  |  Top
   public OutputStream openOutputStream()  throws IOException

Create a file with the specified name - returns the output stream which can be used to write to this file.

Implements:
openOutputStream in interface FileInfo


· renameFile

Summary  |  Top
   public void renameFile(FileInfo newName)  throws IOException

Rename this file to the specified name

Implements:
renameFile in interface FileInfo


· toString

Summary  |  Top
   public String toString() 

Return a readable string

Overrides:
toString in class Object


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7