-
- All Implemented Interfaces:
-
com.cognifide.gradle.common.file.transfer.FileTransfer,com.cognifide.gradle.common.file.transfer.FileTransferHandler,java.io.Serializable
public final class CustomFileTransfer extends ProtocolFileTransfer
Represents dynamically created file transfer via build script.Allows to implement file transfer supporting cloud storage like Amazon S3, Google Cloud Storage etc and use them for uploading, downloading and listing files.
-
-
Constructor Summary
Constructors Constructor Description CustomFileTransfer(CommonExtension common)
-
Method Summary
Modifier and Type Method Description final Unitdownload(Function3<String, String, File, Unit> callback)Register callback responsible for downloading file. final Unitupload(Function3<String, String, File, Unit> callback)Register callback responsible for uploading file. final Unitlist(Function1<String, List<FileEntry>> callback)Register callback responsible for listing files. List<FileEntry>list(String dirUrl)Lists files in directory available at specified URL. final Unitdelete(Function2<String, String, Unit> callback)Register callback responsible for deleting file. final Unittruncate(Function1<String, Unit> callback)Register callback responsible for deleting files. Unittruncate(String dirUrl)Deletes all files in directory available at specified URL. final Unitexists(Function2<String, String, Boolean> callback)Register callback responsible for checking file existence. Booleanexists(String dirUrl, String fileName)Checks if file with given name exists in directory at specified URL. UnitdownloadFrom(String dirUrl, String fileName, File target)Downloads file with given name from directory available at specified URL. UnituploadTo(String dirUrl, String fileName, File source)Uploads file to directory available at specified URL and set given name. UnitdeleteFrom(String dirUrl, String fileName)Deletes file of given name in directory available at specified URL. StringgetName()Unique identifier. List<String>getProtocols()Provider<Boolean>getParallelable()Determines if operations using this transfer could be done in parallel. Property<Boolean>getEnabled()When enabled, transfer will be considered when finding transfer handling particular URL. UnitsetName(String name)Unique identifier. UnitsetProtocols(List<String> protocols)-
Methods inherited from class com.cognifide.gradle.common.file.transfer.ProtocolFileTransfer
download, downloader, stat, uploader -
Methods inherited from class com.cognifide.gradle.common.file.transfer.FileTransferHandler
delete, download, downloadTo, exists, stat, upload, uploadTo -
Methods inherited from class com.cognifide.gradle.common.file.transfer.generic.CustomFileTransfer
handles -
Methods inherited from class com.cognifide.gradle.common.file.transfer.FileTransfer
equals, hashCode, toString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
CustomFileTransfer
CustomFileTransfer(CommonExtension common)
-
-
Method Detail
-
download
final Unit download(Function3<String, String, File, Unit> callback)
Register callback responsible for downloading file.
-
upload
final Unit upload(Function3<String, String, File, Unit> callback)
Register callback responsible for uploading file.
-
list
final Unit list(Function1<String, List<FileEntry>> callback)
Register callback responsible for listing files.
-
delete
final Unit delete(Function2<String, String, Unit> callback)
Register callback responsible for deleting file.
-
truncate
final Unit truncate(Function1<String, Unit> callback)
Register callback responsible for deleting files.
-
exists
final Unit exists(Function2<String, String, Boolean> callback)
Register callback responsible for checking file existence.
-
exists
Boolean exists(String dirUrl, String fileName)
Checks if file with given name exists in directory at specified URL.
-
downloadFrom
Unit downloadFrom(String dirUrl, String fileName, File target)
Downloads file with given name from directory available at specified URL.
-
uploadTo
Unit uploadTo(String dirUrl, String fileName, File source)
Uploads file to directory available at specified URL and set given name.
-
deleteFrom
Unit deleteFrom(String dirUrl, String fileName)
Deletes file of given name in directory available at specified URL.
-
getProtocols
List<String> getProtocols()
-
getParallelable
Provider<Boolean> getParallelable()
Determines if operations using this transfer could be done in parallel.
-
getEnabled
Property<Boolean> getEnabled()
When enabled, transfer will be considered when finding transfer handling particular URL.
-
setProtocols
Unit setProtocols(List<String> protocols)
-
-
-
-