Package tv.hd3g.transfertfiles
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 Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCommonAbstractFileSystem(String basePath, String standardHostname) -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanUse standardHostName to alter hashCode/equals behavior.getPathFromRelative(String path) DO NOT LEAK TO USER!longfinal inthashCode()Use standardHostName to alter hashCode/equals behavior.voidsetTimeout(long duration, TimeUnit unit) Set socket/connection timeout.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface tv.hd3g.transfertfiles.AbstractFileSystem
connect, getFromPath, getFromPath, getHost, getIOBufferSize, getUsername, isAvaliable, isReusable, reusableHashCode
-
Field Details
-
timeoutDuration
protected long timeoutDuration
-
-
Constructor Details
-
CommonAbstractFileSystem
- 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
DO NOT LEAK TO USER!- Returns:
- absolute path from server.
-
getBasePath
-
hashCode
public final int hashCode()Use standardHostName to alter hashCode/equals behavior. -
equals
Use standardHostName to alter hashCode/equals behavior. -
setTimeout
Description copied from interface:AbstractFileSystemSet socket/connection timeout.- Specified by:
setTimeoutin interfaceAbstractFileSystem<T extends AbstractFile>
-
getTimeout
public long getTimeout()- Specified by:
getTimeoutin interfaceAbstractFileSystem<T extends AbstractFile>
-