Package unlimited.fc.client.api.filelist
Interface FileListDataItemSource
-
- All Known Subinterfaces:
FileTransferData,FileTransferMechanism
- All Known Implementing Classes:
AutoRecoverClient,FCClient,FileTransferMechansimAdapter,MultiClientManager,PooledClient,ReadOnlyClient,SynchClient,TransferMechanismData
public interface FileListDataItemSource
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description voiddelete(java.lang.String file)Deletes the specified file from the remote file system.voidget(java.lang.String localPath, java.lang.String remoteFile, int inRate, long offset, long size, int numDFEncoders, int blockSize, int unitSize, int mode)Downloads a file from the FC Server, and places it on the file system.intgetMode()The current transfer mode of this client.intgetStartRate()Returns the current start rate for FC transfers.intgetUnitSize()Deprecated.Method deprecated.booleanisFileCatalystServer()Returns true if connected to a FileCatalyst server.booleanisForceFileOwnershipEnabled()Returns true if the force file ownership feature is currently enabled.FileListDatalist()Returns meta data for files in the current remote directory.default java.util.List<FileListDataItem>listAsList()a convenience method that returns list() as a basic java.util.Listjava.lang.String[]prms(java.lang.String filename)Return the file permission of the file/directory listed in the argument from the remote server.voidsetFileFilter(FileCatalystFileFilter<?> filter)Sets the FileFilter that is to be used by the implementation.voidsetForceFileOwnershipEnabled(boolean isForceFileOwnershipEnabled)Sets whether or not the force file ownership feature is enabled.longsize(java.lang.String remoteFile)Return the size of a remote filedefault java.util.stream.Stream<FileListDataItem>streamWithInlineParse()Returns streaming meta data for files in the current remote directory.java.util.stream.Stream<FileListDataItem>streamWithInlineParse(java.util.function.BooleanSupplier isCancelled)Returns streaming meta data for files in the current remote directory.
-
-
-
Method Detail
-
setFileFilter
void setFileFilter(FileCatalystFileFilter<?> filter) throws java.io.IOException, unlimited.core.util.common.exception.FCException
Sets the FileFilter that is to be used by the implementation.- Parameters:
filter- Filter to set- Throws:
java.io.IOExceptionunlimited.core.util.common.exception.FCException
-
isFileCatalystServer
boolean isFileCatalystServer() throws java.io.IOException, unlimited.core.util.common.exception.FCExceptionReturns true if connected to a FileCatalyst server. Returns false if connected to a standard FTP server.- Returns:
- true if connected to a FileCatalyst server.
- Throws:
java.io.IOExceptionunlimited.core.util.common.exception.FCException
-
streamWithInlineParse
default java.util.stream.Stream<FileListDataItem> streamWithInlineParse() throws unlimited.core.util.common.exception.FCException, java.io.IOException
Returns streaming meta data for files in the current remote directory. Use if you expect a large collection of files to be returned from the Server- Returns:
- stream of FileListDataItems
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occursStreamClosedException- If the stream gets closed during operations
-
streamWithInlineParse
java.util.stream.Stream<FileListDataItem> streamWithInlineParse(java.util.function.BooleanSupplier isCancelled) throws unlimited.core.util.common.exception.FCException, java.io.IOException
Returns streaming meta data for files in the current remote directory. Use if you expect a large collection of files to be returned from the Server- Parameters:
isCancelled- cancel handler to stop stream on cancel- Returns:
- stream of FileListDataItems
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occursStreamClosedException- If the stream gets closed during operations
-
list
FileListData list() throws unlimited.core.util.common.exception.FCException, java.io.IOException
Returns meta data for files in the current remote directory. Use to see what files exist and can be downloaded from the connected Server- Returns:
- meta data for files in the current remote directory.
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
listAsList
default java.util.List<FileListDataItem> listAsList() throws unlimited.core.util.common.exception.FCException, java.io.IOException
a convenience method that returns list() as a basic java.util.List- Returns:
- meta data for files in the current remote directory
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
prms
java.lang.String[] prms(java.lang.String filename) throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionReturn the file permission of the file/directory listed in the argument from the remote server.- Parameters:
fileName- name of the file- Returns:
- permissions
- Throws:
unlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
isForceFileOwnershipEnabled
boolean isForceFileOwnershipEnabled()
Returns true if the force file ownership feature is currently enabled. If it is, then all files downloaded this client will have their ownership changed to current values for the ForceFileOwnershipUsername, and ForceFileOwnershipGroupname- Returns:
- the isForceFileOwnershipEnabled
-
setForceFileOwnershipEnabled
void setForceFileOwnershipEnabled(boolean isForceFileOwnershipEnabled)
Sets whether or not the force file ownership feature is enabled. If it is, then all files downloaded this client will have their ownership changed to current values for the ForceFileOwnershipUsername, and ForceFileOwnershipGroupname- Parameters:
isForceFileOwnershipEnabled- the isForceFileOwnershipEnabled to set
-
size
long size(java.lang.String remoteFile) throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionReturn the size of a remote file- Parameters:
remoteFile- String The path to the remote file- Returns:
- long the size of the remote file or -1 if it doesn't exist
- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
getStartRate
int getStartRate()
Returns the current start rate for FC transfers. All FC transfer will begin at this rate and ramp up to the specified target rate if no congestion is encounters.Note: Congestion control must be enabled for this value to have an effect.
- Returns:
- The current start rate for FC transfers in Kilobits per second
-
getUnitSize
@Deprecated int getUnitSize()
Deprecated.Method deprecated. Use getPacketSize() insteadUse getPacketSize- Returns:
- The current unit size. In Bytes.
-
getMode
int getMode()
The current transfer mode of this client.The possible returns values can be found at the following locations:
- UDP:
TransferMode.UDP - FTP:
TransferMode.FTP - HTTP:
TransferMode.HTTP - AUTO:
TransferMode.AUTO
- Returns:
- current transfer mode (UDP, FTP, AUTO) of this client
- UDP:
-
get
void get(java.lang.String localPath, java.lang.String remoteFile, int inRate, long offset, long size, int numDFEncoders, int blockSize, int unitSize, int mode) throws java.io.IOException, unlimited.core.util.common.exception.FCException, java.security.NoSuchAlgorithmException, unlimited.core.util.common.exception.FCException, java.io.IOExceptionDownloads a file from the FC Server, and places it on the file system.- Parameters:
localPath- Location of where to store the file after it has been downloadedremoteFile- Remote file to be downloaded from the ServerinRate- Rate to use for the download transferoffset- Location in the local file to start placing downloaded data into (0 = start of file)size- Amount of date to retrieve from the FC Server. (Typically this is (remote file size - (offset))numDFEncoders- Number of encoders to use for theblockSize- Size of blocks to be used in the download transferunitSize- Size of the individual units in the download transfer. Value with compared with the Server's max unit size. Minimum of the two values will be usedmode- Transfer mode to be used for the download. Available modes can be atTransferMode- Throws:
java.io.IOExceptionunlimited.core.util.common.exception.FCExceptionjava.security.NoSuchAlgorithmExceptionunlimited.core.util.common.exception.FCExceptionjava.io.IOException
-
delete
void delete(java.lang.String file) throws unlimited.core.util.common.exception.FCException, java.io.IOExceptionDeletes the specified file from the remote file system.- Parameters:
file- The file to be deleted- Throws:
unlimited.core.util.common.exception.FCException- If an error in the FC protocol occursjava.io.IOException- If a timeout, or other IO error occurs
-
-