public class Resolver<G extends FileGroup>
File downloader with groups supporting files from multiple sources: local and remote (SFTP, SMB, HTTP).
@NotNull public static java.lang.String GROUP_DEFAULT
public static com.cognifide.gradle.aem.common.file.resolver.Resolver.Companion Companion
public Resolver(@NotNull
AemExtension aem,
@NotNull
java.io.File downloadDir)
File downloader with groups supporting files from multiple sources: local and remote (SFTP, SMB, HTTP).
public int getParallelLevel()
Controls count of groups resolved in parallel.
public void setParallelLevel(int p)
Controls count of groups resolved in parallel.
@NotNull public java.util.List<java.lang.String> getLocalFilePatterns()
Files respected when searching for recent local files.
public void setLocalFilePatterns(@NotNull
java.util.List<java.lang.String> p)
Files respected when searching for recent local files.
@Internal @NotNull public java.util.List<G> getGroups()
@Internal @NotNull public java.util.List<java.io.File> getOutputDirs()
@NotNull
public java.util.List<java.io.File> outputDirs(@NotNull
kotlin.jvm.functions.Function1<? super G,java.lang.Boolean> filter)
@Internal @NotNull public java.util.List<java.io.File> getAllFiles()
@NotNull
public java.util.List<java.io.File> allFiles(@NotNull
kotlin.jvm.functions.Function1<? super G,java.lang.Boolean> filter)
@NotNull
public java.util.List<G> allGroups(@NotNull
kotlin.jvm.functions.Function1<? super G,java.lang.Boolean> filter)
@NotNull
public G group(@NotNull
java.lang.String name)
@NotNull public FileResolution get(@NotNull java.lang.Object value)
Resolve file in case of various type of specified value: file, url to file, dependency notation.
@NotNull public FileResolution resolve(@NotNull java.lang.String dependencyNotation)
Resolve file by dependency notation using defined Gradle repositories (Maven, Ivy etc).
@NotNull public FileResolution resolve(@NotNull kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.build.DependencyOptions,kotlin.Unit> dependencyOptions)
Resolve file using defined Gradle repositories (Maven, Ivy etc).
@NotNull
public java.util.List<com.cognifide.gradle.aem.common.file.resolver.FileResolution> download(@NotNull
java.lang.String urlDir,
@NotNull
java.lang.String... fileNames)
Download files from same URL using automatically determined file transfer (HTTP, SFTP, SMB, URL, local file system).
@NotNull
public java.util.List<com.cognifide.gradle.aem.common.file.resolver.FileResolution> download(@NotNull
java.lang.String urlDir,
@NotNull
java.lang.Iterable<java.lang.String> fileNames)
Download files from same URL using automatically determined file transfer (HTTP, SFTP, SMB, URL, local file system).
@NotNull public FileResolution download(@NotNull java.lang.String url)
Download file using automatically determined file transfer (HTTP, SFTP, SMB, URL, local file system).
Same global settings (like basic auth credentials of HTTP) of each particular file transfer will be used for all files downloaded. This shorthand method assumes that mostly only single HTTP / SFTP / SMB server will be used to download all files.
To use many remote servers with different settings, simply use dedicated methods 'downloadHttp/Sftp/Smb' when declaring each file to be downloaded.
@NotNull public FileResolution downloadHttp(@NotNull java.lang.String url, @NotNull kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.file.transfer.http.HttpFileTransfer,kotlin.Unit> options)
Download file using HTTP file transfer with custom settings (like basic auth credentials).
Use only when using more than one remote HTTP server to download files.
@NotNull public FileResolution downloadSftp(@NotNull java.lang.String url, @NotNull kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.file.transfer.sftp.SftpFileTransfer,kotlin.Unit> options)
Download file using SFTP file transfer with custom settings (different credentials).
Use only when using more than one remote SFTP server to download files.
@NotNull public FileResolution downloadSmb(@NotNull java.lang.String url, @NotNull kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.file.transfer.smb.SmbFileTransfer,kotlin.Unit> options)
Download file using SMB file transfer with custom settings (different credentials, domain).
Use only when using more than one remote SMB server to download files.
@NotNull public FileResolution useLocal(@NotNull java.lang.String path)
Use local file directly (without copying).
@NotNull public FileResolution useLocal(@NotNull java.io.File sourceFile)
Use local file directly (without copying).
@Nullable public FileResolution useLocalBy(@NotNull java.lang.Object dir, @NotNull java.lang.Iterable<java.lang.String> filePatterns, @NotNull kotlin.jvm.functions.Function1<? super java.lang.Iterable<? extends java.io.File>,? extends java.io.File> selector)
Use local file from directory or file when not found any.
@Nullable public FileResolution useLocalBy(@NotNull java.lang.Object dir, @NotNull kotlin.jvm.functions.Function1<? super java.lang.Iterable<? extends java.io.File>,? extends java.io.File> selector)
Use local file from directory or file when not found any.
@Nullable public FileResolution useLocalLastNamed(@NotNull java.lang.Object dir)
Use local file with name being highest version located in directory or fail when not found any. Highest version is determined by descending alphanumeric sorting.
@Nullable public FileResolution useLocalLastModified(@NotNull java.lang.Object dir)
Use last modified local file located in directory or fail when not found any.
@Nullable public FileResolution useLocalRecent(@NotNull java.lang.Object dir)
Use last modified local file located in directory or fail when not found any.
public void config(@NotNull
kotlin.jvm.functions.Function1<? super G,kotlin.Unit> configurer)
Customize configuration for particular file group.
@Synchronized
public void group(@NotNull
java.lang.String name,
@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.file.resolver.Resolver<G>,kotlin.Unit> configurer)
public void invoke(@NotNull
java.lang.String $receiver,
@NotNull
java.lang.Object value)
public void invoke(@NotNull
java.lang.String $receiver,
@NotNull
kotlin.jvm.functions.Function1<? super com.cognifide.gradle.aem.common.file.resolver.Resolver<G>,kotlin.Unit> configurer)
public void group(@NotNull
java.lang.String name,
@NotNull
java.lang.String downloadUrl)
Shorthand for creating named group with single file only to be downloaded.
@NotNull
public G createGroup(@NotNull
java.lang.String name)
@Internal @NotNull public AemExtension getAem()
@Internal @NotNull public java.io.File getDownloadDir()