de.unkrig.commons.net.ftp.ftplett
Interface Ftplett

All Known Implementing Classes:
FileFtplett

public interface Ftplett

Defines the semantics of the FTP protocol, in analogy with the Servlett.


Method Summary
 boolean changeWorkingDirectory(java.lang.String directoryName)
           
 boolean delete(java.lang.String resourceName)
           
 java.util.Date getModificationTime(java.lang.String resourceName)
           
 java.lang.String getWorkingDirectory()
           
 boolean list(java.lang.String name, ConsumerWhichThrows<java.lang.String,java.io.IOException> lineConsumer)
           
 boolean nameList(java.lang.String name, ConsumerWhichThrows<java.lang.String,java.io.IOException> lineConsumer)
           
 boolean rename(java.lang.String from, java.lang.String to)
           
 java.io.InputStream retrieve(java.lang.String resourceName)
           
 java.io.OutputStream store(java.lang.String resourceName)
           
 

Method Detail

changeWorkingDirectory

boolean changeWorkingDirectory(@Nullable
                               java.lang.String directoryName)
                               throws java.io.IOException
Parameters:
directoryName - null means change to some 'root' or 'home' directory
Returns:
Whether the working directory could be changed to the given directory.
Throws:
java.io.IOException

getWorkingDirectory

java.lang.String getWorkingDirectory()
Returns:
The current working directory

retrieve

@Nullable
java.io.InputStream retrieve(java.lang.String resourceName)
                             throws java.io.IOException
Returns:
An InputStream producing the contents of the resource, or null iff the resource cannot be accessed.
Throws:
java.io.IOException

store

@Nullable
java.io.OutputStream store(java.lang.String resourceName)
                           throws java.io.IOException
Returns:
An OutputStream to which the contents can be written, or null iff the resource cannot be accessed.
Throws:
java.io.IOException

list

boolean list(@Nullable
             java.lang.String name,
             ConsumerWhichThrows<java.lang.String,java.io.IOException> lineConsumer)
             throws java.io.IOException
Parameters:
name - The name of the directory or file to list, or null to list the current working directory
lineConsumer - Consumes the listing
Throws:
java.io.IOException

nameList

boolean nameList(@Nullable
                 java.lang.String name,
                 ConsumerWhichThrows<java.lang.String,java.io.IOException> lineConsumer)
                 throws java.io.IOException
Parameters:
name - The name of the directory or file to list, or null to list the current working directory
lineConsumer - Consumes the listing
Throws:
java.io.IOException

delete

boolean delete(java.lang.String resourceName)
               throws java.io.IOException
Returns:
Whether the resource was successfully deleted
Throws:
java.io.IOException

rename

boolean rename(java.lang.String from,
               java.lang.String to)
               throws java.io.IOException
Returns:
Whether the resource was successfully renamed
Throws:
java.io.IOException

getModificationTime

@Nullable
java.util.Date getModificationTime(java.lang.String resourceName)
                                   throws java.io.IOException
Returns:
null iff the modification time cannot be determined
Throws:
java.io.IOException