org.apache.ftpserver.ftplet
Interface FileObject


public interface FileObject

This is the file abstraction used by the server.


Method Summary
 java.io.InputStream createInputStream(long offset)
          Create input stream for reading.
 java.io.OutputStream createOutputStream(long offset)
          Create output stream for writing.
 boolean delete()
          Delete file.
 boolean doesExist()
          Does this file exists?
 java.lang.String getFullName()
          Get the fully qualified name.
 java.lang.String getGroupName()
          Get owner group name.
 long getLastModified()
          Get last modified time.
 int getLinkCount()
          Get link count.
 java.lang.String getOwnerName()
          Get the owner name.
 java.lang.String getShortName()
          Get the file short name.
 long getSize()
          Get file size.
 boolean hasDeletePermission()
          Has delete permission?
 boolean hasReadPermission()
          Has read permission?
 boolean hasWritePermission()
          Has write permission?
 boolean isDirectory()
          Is it a directory?
 boolean isFile()
          Is it a file?
 boolean isHidden()
          Is a hidden file?
 FileObject[] listFiles()
          List file objects.
 boolean mkdir()
          Create directory.
 boolean move(FileObject destination)
          Move file.
 

Method Detail

getFullName

java.lang.String getFullName()
Get the fully qualified name.


getShortName

java.lang.String getShortName()
Get the file short name.


isHidden

boolean isHidden()
Is a hidden file?


isDirectory

boolean isDirectory()
Is it a directory?


isFile

boolean isFile()
Is it a file?


doesExist

boolean doesExist()
Does this file exists?


hasReadPermission

boolean hasReadPermission()
Has read permission?


hasWritePermission

boolean hasWritePermission()
Has write permission?


hasDeletePermission

boolean hasDeletePermission()
Has delete permission?


getOwnerName

java.lang.String getOwnerName()
Get the owner name.


getGroupName

java.lang.String getGroupName()
Get owner group name.


getLinkCount

int getLinkCount()
Get link count.


getLastModified

long getLastModified()
Get last modified time.


getSize

long getSize()
Get file size.


mkdir

boolean mkdir()
Create directory.


delete

boolean delete()
Delete file.


move

boolean move(FileObject destination)
Move file.


listFiles

FileObject[] listFiles()
List file objects. If not a directory or does not exist, null will be returned. Files must be returned in alphabetical order.


createOutputStream

java.io.OutputStream createOutputStream(long offset)
                                        throws java.io.IOException
Create output stream for writing. If the file is not random accessible, any offset other than zero will throw an exception.

Throws:
java.io.IOException

createInputStream

java.io.InputStream createInputStream(long offset)
                                      throws java.io.IOException
Create input stream for reading. If the file is not random accessible, any offset other than zero will throw an exception.

Throws:
java.io.IOException


Copyright © 2003-2008 The Apache Software Foundation. All Rights Reserved.