当前位置: 首页>>代码示例>>Java>>正文


Java FileCopyDetails类代码示例

本文整理汇总了Java中org.gradle.api.file.FileCopyDetails的典型用法代码示例。如果您正苦于以下问题:Java FileCopyDetails类的具体用法?Java FileCopyDetails怎么用?Java FileCopyDetails使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


FileCopyDetails类属于org.gradle.api.file包,在下文中一共展示了FileCopyDetails类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import org.gradle.api.file.FileCopyDetails; //导入依赖的package包/类
public void execute(FileCopyDetails fileCopyDetails) {
    PluginDescriptor descriptor;
    try {
        descriptor = new PluginDescriptor(fileCopyDetails.getFile().toURI().toURL());
    } catch (MalformedURLException e) {
        // Not sure under what scenario (if any) this would occur,
        // but there's no sense in collecting the descriptor if it does.
        return;
    }
    if (descriptor.getImplementationClassName() != null) {
        descriptors.add(descriptor);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:14,代码来源:JavaGradlePluginPlugin.java

示例2: visitFile

import org.gradle.api.file.FileCopyDetails; //导入依赖的package包/类
private void visitFile(FileCopyDetails fileDetails) {
    try {
        TarEntry archiveEntry = new TarEntry(fileDetails.getRelativePath().getPathString());
        archiveEntry.setModTime(fileDetails.getLastModified());
        archiveEntry.setSize(fileDetails.getSize());
        archiveEntry.setMode(UnixStat.FILE_FLAG | fileDetails.getMode());
        tarOutStr.putNextEntry(archiveEntry);
        fileDetails.copyTo(tarOutStr);
        tarOutStr.closeEntry();
    } catch (Exception e) {
        throw new GradleException(String.format("Could not add %s to TAR '%s'.", fileDetails, tarFile), e);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:14,代码来源:TarCopyAction.java

示例3: visitDir

import org.gradle.api.file.FileCopyDetails; //导入依赖的package包/类
private void visitDir(FileCopyDetails dirDetails) {
    try {
        // Trailing slash on name indicates entry is a directory
        TarEntry archiveEntry = new TarEntry(dirDetails.getRelativePath().getPathString() + '/');
        archiveEntry.setModTime(dirDetails.getLastModified());
        archiveEntry.setMode(UnixStat.DIR_FLAG | dirDetails.getMode());
        tarOutStr.putNextEntry(archiveEntry);
        tarOutStr.closeEntry();
    } catch (Exception e) {
        throw new GradleException(String.format("Could not add %s to TAR '%s'.", dirDetails, tarFile), e);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:13,代码来源:TarCopyAction.java

示例4: visitFile

import org.gradle.api.file.FileCopyDetails; //导入依赖的package包/类
private void visitFile(FileCopyDetails fileDetails) {
    try {
        ZipEntry archiveEntry = new ZipEntry(fileDetails.getRelativePath().getPathString());
        archiveEntry.setTime(fileDetails.getLastModified());
        archiveEntry.setUnixMode(UnixStat.FILE_FLAG | fileDetails.getMode());
        zipOutStr.putNextEntry(archiveEntry);
        fileDetails.copyTo(zipOutStr);
        zipOutStr.closeEntry();
    } catch (Exception e) {
        throw new GradleException(String.format("Could not add %s to ZIP '%s'.", fileDetails, zipFile), e);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:13,代码来源:ZipCopyAction.java

示例5: visitDir

import org.gradle.api.file.FileCopyDetails; //导入依赖的package包/类
private void visitDir(FileCopyDetails dirDetails) {
    try {
        // Trailing slash in name indicates that entry is a directory
        ZipEntry archiveEntry = new ZipEntry(dirDetails.getRelativePath().getPathString() + '/');
        archiveEntry.setTime(dirDetails.getLastModified());
        archiveEntry.setUnixMode(UnixStat.DIR_FLAG | dirDetails.getMode());
        zipOutStr.putNextEntry(archiveEntry);
        zipOutStr.closeEntry();
    } catch (Exception e) {
        throw new GradleException(String.format("Could not add %s to ZIP '%s'.", dirDetails, zipFile), e);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:13,代码来源:ZipCopyAction.java

示例6: processFile

import org.gradle.api.file.FileCopyDetails; //导入依赖的package包/类
private void processFile(FileVisitDetails visitDetails) {
    DefaultFileCopyDetails details = createDefaultFileCopyDetails(visitDetails);
    for (Action<? super FileCopyDetails> action : copySpecResolver.getAllCopyActions()) {
        action.execute(details);
        if (details.isExcluded()) {
            return;
        }
    }
    action.processFile(details);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:11,代码来源:CopyFileVisitorImpl.java

示例7: filesMatching

import org.gradle.api.file.FileCopyDetails; //导入依赖的package包/类
public CopySpec filesMatching(Iterable<String> patterns, Action<? super FileCopyDetails> action) {
    if (!patterns.iterator().hasNext()) {
        throw new InvalidUserDataException("must provide at least one pattern to match");
    }
    List<Spec> matchers = new ArrayList<Spec>();
    for (String pattern : patterns) {
        matchers.add(PatternMatcherFactory.getPatternMatcher(true, isCaseSensitive(), pattern));
    }
    Spec unionMatcher = Specs.union(matchers.toArray(new Spec[matchers.size()]));
    return eachFile(new MatchingCopyAction(unionMatcher, action));
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:12,代码来源:DefaultCopySpec.java

示例8: filesNotMatching

import org.gradle.api.file.FileCopyDetails; //导入依赖的package包/类
public CopySpec filesNotMatching(Iterable<String> patterns, Action<? super FileCopyDetails> action) {
    if (!patterns.iterator().hasNext()) {
        throw new InvalidUserDataException("must provide at least one pattern to not match");
    }
    List<Spec> matchers = new ArrayList<Spec>();
    for (String pattern : patterns) {
        matchers.add(PatternMatcherFactory.getPatternMatcher(true, isCaseSensitive(), pattern));
    }
    Spec unionMatcher = Specs.union(matchers.toArray(new Spec[matchers.size()]));
    return eachFile(new MatchingCopyAction(Specs.<RelativePath>negate(unionMatcher), action));
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:12,代码来源:DefaultCopySpec.java

示例9: filter

import org.gradle.api.file.FileCopyDetails; //导入依赖的package包/类
public CopySpec filter(final Class<? extends FilterReader> filterType) {
    appendCopyAction(new Action<FileCopyDetails>() {
        public void execute(FileCopyDetails fileCopyDetails) {
            fileCopyDetails.filter(filterType);
        }
    });
    return this;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:DefaultCopySpec.java

示例10: expand

import org.gradle.api.file.FileCopyDetails; //导入依赖的package包/类
public CopySpec expand(final Map<String, ?> properties) {
    appendCopyAction(new Action<FileCopyDetails>() {
        public void execute(FileCopyDetails fileCopyDetails) {
            fileCopyDetails.expand(properties);
        }
    });
    return this;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:DefaultCopySpec.java

示例11: getAllCopyActions

import org.gradle.api.file.FileCopyDetails; //导入依赖的package包/类
public Collection<? extends Action<? super FileCopyDetails>> getAllCopyActions() {
    if (parentResolver == null) {
        return copyActions;
    }
    List<Action<? super FileCopyDetails>> allActions = new ArrayList<Action<? super FileCopyDetails>>();
    allActions.addAll(parentResolver.getAllCopyActions());
    allActions.addAll(copyActions);
    return allActions;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:10,代码来源:DefaultCopySpec.java

示例12: execute

import org.gradle.api.file.FileCopyDetails; //导入依赖的package包/类
public void execute(FileCopyDetails fileCopyDetails) {
    RelativePath path = fileCopyDetails.getRelativePath();
    String newName = transformer.transform(path.getLastName());
    if (newName != null) {
        path = path.replaceLastName(newName);
        fileCopyDetails.setRelativePath(path);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:RenamingCopyAction.java

示例13: processFile

import org.gradle.api.file.FileCopyDetails; //导入依赖的package包/类
private void processFile(FileVisitDetails visitDetails) {
    DefaultFileCopyDetails details = createDefaultFileCopyDetails(visitDetails);
    for (Action<? super FileCopyDetails> action : spec.getAllCopyActions()) {
        action.execute(details);
        if (details.isExcluded()) {
            return;
        }
    }
    action.processFile(details);
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:11,代码来源:CopyFileVisitorImpl.java

示例14: writeOriginalFile

import org.gradle.api.file.FileCopyDetails; //导入依赖的package包/类
private void writeOriginalFile(FileCopyDetails fileDetails) {
    String path = fileDetails.getRelativePath().getPathString();
    try {
        ZipEntry archiveEntry = new ZipEntry(path);
        archiveEntry.setTime(fileDetails.getLastModified());
        zipOutStr.putNextEntry(archiveEntry);
        fileDetails.copyTo(zipOutStr);
        zipOutStr.closeEntry();
    } catch (Exception e) {
        throw new GradleException(String.format("Could not add %s to ZIP '%s'.", path, zipFile), e);
    }
}
 
开发者ID:EvidentSolutions,项目名称:gradle-gzjar-plugin,代码行数:13,代码来源:GzJarCopyAction.java

示例15: writeGzippedFile

import org.gradle.api.file.FileCopyDetails; //导入依赖的package包/类
private void writeGzippedFile(FileCopyDetails fileDetails) {
    String path = fileDetails.getRelativePath().getPathString() + ".gz";
    try {
        ZipEntry archiveEntry = new ZipEntry(path);
        archiveEntry.setTime(fileDetails.getLastModified());
        zipOutStr.putNextEntry(archiveEntry);
        GZIPOutputStream out = new GZIPOutputStream(zipOutStr, true);
        fileDetails.copyTo(out);
        out.finish();
        out.flush();
        zipOutStr.closeEntry();
    } catch (Exception e) {
        throw new GradleException(String.format("Could not add %s to ZIP '%s'.", path, zipFile), e);
    }
}
 
开发者ID:EvidentSolutions,项目名称:gradle-gzjar-plugin,代码行数:16,代码来源:GzJarCopyAction.java


注:本文中的org.gradle.api.file.FileCopyDetails类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。