Interface FtpFile


public interface FtpFile
This is the file abstraction used by the server.
Author:
Apache MINA Project
  • Method Details

    • getAbsolutePath

      String getAbsolutePath()
      Get the full path from the base directory of the FileSystemView.
      Returns:
      a path where the path separator is '/' (even if the operating system uses another character as path separator).
    • getName

      String getName()
      Get the file name of the file.
      Returns:
      the last part of the file path (the part after the last '/').
    • isHidden

      boolean isHidden()
      Is the file hidden?
      Returns:
      true if the FtpFile is hidden
    • isDirectory

      boolean isDirectory()
      Is it a directory?
      Returns:
      true if the FtpFile is a directory
    • isFile

      boolean isFile()
      Is it a file?
      Returns:
      true if the FtpFile is a file, false if it is a directory
    • doesExist

      boolean doesExist()
      Does this file exists?
      Returns:
      true if the FtpFile exists
    • isReadable

      boolean isReadable()
      Has read permission?
      Returns:
      true if the FtpFile is readable by the user
    • isWritable

      boolean isWritable()
      Has write permission?
      Returns:
      true if the FtpFile is writable by the user
    • isRemovable

      boolean isRemovable()
      Has delete permission?
      Returns:
      true if the FtpFile is removable by the user
    • getOwnerName

      String getOwnerName()
      Get the owner name.
      Returns:
      The name of the owner of the FtpFile
    • getGroupName

      String getGroupName()
      Get owner group name.
      Returns:
      The name of the group that owns the FtpFile
    • getLinkCount

      int getLinkCount()
      Get link count.
      Returns:
      The number of links for the FtpFile
    • getLastModified

      long getLastModified()
      Get last modified time in UTC.
      Returns:
      The timestamp of the last modified time for the FtpFile
    • setLastModified

      boolean setLastModified(long time)
      Set the last modified time stamp of a file.
      Parameters:
      time - The last modified time, in milliseconds since the epoch. See File.setLastModified(long).
      Returns:
      true if and only if the operation succeeded; false otherwise
    • getSize

      long getSize()
      Get file size.
      Returns:
      The size of the FtpFile in bytes
    • getPhysicalFile

      Object getPhysicalFile()
      Returns the physical location or path of the file. It is completely up to the implementation to return appropriate value based on the file system implementation.
      Returns:
      the physical location or path of the file.
    • mkdir

      boolean mkdir()
      Create directory.
      Returns:
      true if the operation was successful
    • delete

      boolean delete()
      Delete file.
      Returns:
      true if the operation was successful
    • move

      boolean move(FtpFile destination)
      Move file.
      Parameters:
      destination - The target FtpFile to move the current FtpFile to
      Returns:
      true if the operation was successful
    • listFiles

      List<? extends FtpFile> listFiles()
      List file objects. If not a directory or does not exist, null will be returned. Files must be returned in alphabetical order. List must be immutable.
      Returns:
      The List of FtpFiles
    • createOutputStream

      OutputStream createOutputStream(long offset) throws IOException
      Create output stream for writing.
      Parameters:
      offset - The number of bytes at where to start writing. If the file is not random accessible, any offset other than zero will throw an exception.
      Returns:
      An OutputStream used to write to the FtpFile
      Throws:
      IOException - If the OutputStream creation failed
    • createInputStream

      InputStream createInputStream(long offset) throws IOException
      Create input stream for reading.
      Parameters:
      offset - The number of bytes of where to start reading. If the file is not random accessible, any offset other than zero will throw an exception.
      Returns:
      An InputStream used to read the FtpFile
      Throws:
      IOException - If the InputStream creation failed