Class FTPFileRef

java.lang.Object
org.apache.commons.net.ftp.FTPFile
org.frankframework.filesystem.ftp.FTPFileRef
All Implemented Interfaces:
Serializable

public class FTPFileRef extends org.apache.commons.net.ftp.FTPFile
Wrapper around a FTPFile to allow for relative path operations
Author:
Niels Meijer
See Also:
  • Field Summary

    Fields inherited from class org.apache.commons.net.ftp.FTPFile

    DIRECTORY_TYPE, EXECUTE_PERMISSION, FILE_TYPE, GROUP_ACCESS, READ_PERMISSION, SYMBOLIC_LINK_TYPE, UNKNOWN_TYPE, USER_ACCESS, WORLD_ACCESS, WRITE_PERMISSION
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new file reference, strips the folder of the filename when present
    FTPFileRef(String name, String folder)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static FTPFileRef
    fromFTPFile(org.apache.commons.net.ftp.FTPFile ftpFile)
    Creates a deep-copy of FTPFile
    static FTPFileRef
    fromFTPFile(org.apache.commons.net.ftp.FTPFile ftpFile, String folder)
    Creates a deep-copy of FTPFile, relative to the provided folder
    Returns the filename, not the full (relative) path
    Returns the canonical name inclusive file path when present
    void
    Strip folder prefix of filename if present.
     
    void
    updateFTPFile(org.apache.commons.net.ftp.FTPFile ftpFile)
    Update the FTPFile attributes

    Methods inherited from class org.apache.commons.net.ftp.FTPFile

    getGroup, getHardLinkCount, getLink, getRawListing, getSize, getTimestamp, getTimestampInstant, getType, getUser, hasPermission, isDirectory, isFile, isSymbolicLink, isUnknown, isValid, setGroup, setHardLinkCount, setLink, setPermission, setRawListing, setSize, setTimestamp, setType, setUser, toFormattedString, toFormattedString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • FTPFileRef

      public FTPFileRef(String name)
      Create a new file reference, strips the folder of the filename when present
    • FTPFileRef

      public FTPFileRef(String name, String folder)
      Parameters:
      name - A canonical name might be provided, strip the path when present and only use the actual file name.
      folder - The directory the file. This always has precedence over the canonical path provided by the name.
  • Method Details

    • getFileName

      public String getFileName()
      Returns the filename, not the full (relative) path
    • setName

      public void setName(String name)
      Strip folder prefix of filename if present. May not be changed after creation
      Overrides:
      setName in class org.apache.commons.net.ftp.FTPFile
    • getName

      public String getName()
      Returns the canonical name inclusive file path when present
      Overrides:
      getName in class org.apache.commons.net.ftp.FTPFile
    • toString

      public String toString()
      Overrides:
      toString in class org.apache.commons.net.ftp.FTPFile
    • updateFTPFile

      public void updateFTPFile(org.apache.commons.net.ftp.FTPFile ftpFile)
      Update the FTPFile attributes
    • fromFTPFile

      public static FTPFileRef fromFTPFile(org.apache.commons.net.ftp.FTPFile ftpFile)
      Creates a deep-copy of FTPFile
    • fromFTPFile

      public static FTPFileRef fromFTPFile(org.apache.commons.net.ftp.FTPFile ftpFile, String folder)
      Creates a deep-copy of FTPFile, relative to the provided folder