All Packages  This Package  Class Hierarchy  Class Search  Index

Interface kh.io.FileInfo

  Summary

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

This interface provides standard methods supported by both kh.net.FtpFile and kh.io.LocalFile. This allows FtpFiles and File to be compared and merged using the same code.


  Cross Reference

Returned By:
FileInfo.createChild(), FileInfo.getChild(), FileInfo.getParentInfo(), LocalFileInfo.createChild(), LocalFileInfo.getChild(), LocalFileInfo.getParentInfo(), FtpFile.createChild(), FtpFile.getChild(), FtpFile.getParentInfo()

Implemented By:
LocalFileInfo, FtpFile





  Methods

· createChild

Summary  |  Top
   public abstract 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.



· deleteFile

Summary  |  Top
   public abstract void deleteFile()  throws IOException

Delete the specified file.



· getChild

Summary  |  Top
   public abstract 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



· getChildren

Summary  |  Top
   public abstract Enumeration getChildren()  throws IOException

Return an Enumeration of kh.io.FileInfo containing current directory contents



· getLength

Summary  |  Top
   public abstract long getLength() 

Return the number of bytes in this file



· getModDate

Summary  |  Top
   public abstract Date getModDate() 

Return the mod date for this file



· getName

Summary  |  Top
   public abstract String getName() 

Return the name of this file - not including parent components.



· getParentInfo

Summary  |  Top
   public abstract FileInfo getParentInfo() 

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



· isDirectory

Summary  |  Top
   public abstract boolean isDirectory() 

Return true if this file represents a directory



· isFile

Summary  |  Top
   public abstract boolean isFile() 

Return true if a 'regular' file



· isWritable

Summary  |  Top
   public abstract boolean isWritable() 

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



· openInputStream

Summary  |  Top
   public abstract 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().



· openOutputStream

Summary  |  Top
   public abstract OutputStream openOutputStream()  throws IOException

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



· renameFile

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

Rename this file to the specified name



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