Search in sources :

Example 1 with FileTreeAdapter

use of org.gradle.api.internal.file.collections.FileTreeAdapter in project gradle by gradle.

the class DefaultFileOperations method tarTree.

public FileTree tarTree(Object tarPath) {
    File tarFile = null;
    ReadableResourceInternal resource;
    if (tarPath instanceof ReadableResourceInternal) {
        resource = (ReadableResourceInternal) tarPath;
    } else if (tarPath instanceof ReadableResource) {
        // custom type
        resource = new UnknownBackingFileReadableResource((ReadableResource) tarPath);
    } else {
        tarFile = file(tarPath);
        resource = new LocalResourceAdapter(new LocalFileStandInExternalResource(tarFile, fileSystem));
    }
    TarFileTree tarTree = new TarFileTree(tarFile, new MaybeCompressedFileResource(resource), getExpandDir(), fileSystem, fileSystem, directoryFileTreeFactory, streamHasher);
    return new FileTreeAdapter(tarTree, fileResolver.getPatternSetFactory());
}
Also used : ReadableResource(org.gradle.api.resources.ReadableResource) LocalResourceAdapter(org.gradle.api.resources.internal.LocalResourceAdapter) LocalFileStandInExternalResource(org.gradle.internal.resource.local.LocalFileStandInExternalResource) TarFileTree(org.gradle.api.internal.file.archive.TarFileTree) ReadableResourceInternal(org.gradle.api.resources.internal.ReadableResourceInternal) FileTreeAdapter(org.gradle.api.internal.file.collections.FileTreeAdapter) File(java.io.File)

Aggregations

File (java.io.File)1 TarFileTree (org.gradle.api.internal.file.archive.TarFileTree)1 FileTreeAdapter (org.gradle.api.internal.file.collections.FileTreeAdapter)1 ReadableResource (org.gradle.api.resources.ReadableResource)1 LocalResourceAdapter (org.gradle.api.resources.internal.LocalResourceAdapter)1 ReadableResourceInternal (org.gradle.api.resources.internal.ReadableResourceInternal)1 LocalFileStandInExternalResource (org.gradle.internal.resource.local.LocalFileStandInExternalResource)1