Package 

Class CustomFileTransfer

  • 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.

    • Method Summary

      Modifier and Type Method Description
      final Unit download(Function3<String, String, File, Unit> callback) Register callback responsible for downloading file.
      final Unit upload(Function3<String, String, File, Unit> callback) Register callback responsible for uploading file.
      final Unit list(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 Unit delete(Function2<String, String, Unit> callback) Register callback responsible for deleting file.
      final Unit truncate(Function1<String, Unit> callback) Register callback responsible for deleting files.
      Unit truncate(String dirUrl) Deletes all files in directory available at specified URL.
      final Unit exists(Function2<String, String, Boolean> callback) Register callback responsible for checking file existence.
      Boolean exists(String dirUrl, String fileName) Checks if file with given name exists in directory at specified URL.
      Unit downloadFrom(String dirUrl, String fileName, File target) Downloads file with given name from directory available at specified URL.
      Unit uploadTo(String dirUrl, String fileName, File source) Uploads file to directory available at specified URL and set given name.
      Unit deleteFrom(String dirUrl, String fileName) Deletes file of given name in directory available at specified URL.
      String getName() 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.
      Unit setName(String name) Unique identifier.
      Unit setProtocols(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