Class CommonAbstractFileSystem<T extends AbstractFile>

java.lang.Object
tv.hd3g.transfertfiles.CommonAbstractFileSystem<T>
All Implemented Interfaces:
Closeable, AutoCloseable, AbstractFileSystem<T>
Direct Known Subclasses:
FTPFileSystem, LocalFileSystem, SFTPFileSystem

public abstract class CommonAbstractFileSystem<T extends AbstractFile> extends Object implements AbstractFileSystem<T>
  • Field Details

    • timeoutDuration

      protected long timeoutDuration
  • Constructor Details

    • CommonAbstractFileSystem

      protected CommonAbstractFileSystem(String basePath, String standardHostname)
      Parameters:
      standardHostname - will be use with equals/hashCode to identificate if same servers or not. You should add user/port/server NAME (not IP - it can be non-stable), but not basePath ot protocol.
  • Method Details

    • getPathFromRelative

      public String getPathFromRelative(String path)
      DO NOT LEAK TO USER!
      Returns:
      absolute path from server.
    • getBasePath

      public String getBasePath()
    • hashCode

      public final int hashCode()
      Use standardHostName to alter hashCode/equals behavior.
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Use standardHostName to alter hashCode/equals behavior.
      Overrides:
      equals in class Object
    • setTimeout

      public void setTimeout(long duration, TimeUnit unit)
      Description copied from interface: AbstractFileSystem
      Set socket/connection timeout.
      Specified by:
      setTimeout in interface AbstractFileSystem<T extends AbstractFile>
    • getTimeout

      public long getTimeout()
      Specified by:
      getTimeout in interface AbstractFileSystem<T extends AbstractFile>