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


Java CollectionUtils.join方法代码示例

本文整理汇总了Java中org.gradle.util.CollectionUtils.join方法的典型用法代码示例。如果您正苦于以下问题:Java CollectionUtils.join方法的具体用法?Java CollectionUtils.join怎么用?Java CollectionUtils.join使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.gradle.util.CollectionUtils的用法示例。


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

示例1: resolveAsRelativePath

import org.gradle.util.CollectionUtils; //导入方法依赖的package包/类
public String resolveAsRelativePath(Object path) {
    List<String> basePath = Arrays.asList(StringUtils.split(baseDir.getAbsolutePath(), "/" + File.separator));
    File targetFile = resolve(path);
    List<String> targetPath = new ArrayList<String>(Arrays.asList(StringUtils.split(targetFile.getAbsolutePath(),
            "/" + File.separator)));

    // Find and remove common prefix
    int maxDepth = Math.min(basePath.size(), targetPath.size());
    int prefixLen = 0;
    while (prefixLen < maxDepth && basePath.get(prefixLen).equals(targetPath.get(prefixLen))) {
        prefixLen++;
    }
    basePath = basePath.subList(prefixLen, basePath.size());
    targetPath = targetPath.subList(prefixLen, targetPath.size());

    for (int i = 0; i < basePath.size(); i++) {
        targetPath.add(0, "..");
    }
    if (targetPath.isEmpty()) {
        return ".";
    }
    return CollectionUtils.join(File.separator, targetPath);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:24,代码来源:BaseDirFileResolver.java

示例2: formatMessage

import org.gradle.util.CollectionUtils; //导入方法依赖的package包/类
private String formatMessage(String title, String message) {
    final File icon = iconProvider.getIcon(32, 32);
    List<String> properties = Arrays.asList(
        formatProperty("action", "notification"),
        formatProperty("app", "Gradle Snarl Notifier"),
        formatProperty("class", "alert"),
        formatProperty("title", title),
        formatProperty("text", message),
        formatProperty("icon", icon == null ? null : icon.getAbsolutePath()),
        formatProperty("timeout", "10"));
    return HEAD + CollectionUtils.join("", properties) + "\r\n";
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:13,代码来源:Snarl.java

示例3: toString

import org.gradle.util.CollectionUtils; //导入方法依赖的package包/类
@Override
public String toString() {
    return "{"
            + "dir: '" + getProjectDir().getAbsolutePath() + "'"
            + ", tasks: '" + CollectionUtils.join(" ", getTasks()) + "'"
            + ", arguments: '" + CollectionUtils.join(" ", getArguments()) + "'"
            + ", gradleVersion: " + getGradleVersion()
            + "}";
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:10,代码来源:DefaultGradleBuildInvocationSpec.java

示例4: createTemporaryFile

import org.gradle.util.CollectionUtils; //导入方法依赖的package包/类
public File createTemporaryFile(String prefix, @Nullable String suffix, String... path) {
    File dir = new File(baseDirFactory.create(), CollectionUtils.join("/", path));
    GFileUtils.mkdirs(dir);
    try {
        return File.createTempFile(prefix, suffix, dir);
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:10,代码来源:DefaultTemporaryFileProvider.java

示例5: createTemporaryDirectory

import org.gradle.util.CollectionUtils; //导入方法依赖的package包/类
public File createTemporaryDirectory(@Nullable String prefix, @Nullable String suffix, @Nullable String... path) {
    File dir = new File(baseDirFactory.create(), CollectionUtils.join("/", path));
    GFileUtils.mkdirs(dir);
    try {
        // TODO: This is not a great paradigm for creating a temporary directory.
        // See http://guava-libraries.googlecode.com/svn/tags/release08/javadoc/com/google/common/io/Files.html#createTempDir%28%29 for an alternative.
        File tmpDir = File.createTempFile("gradle", "projectDir", dir);
        tmpDir.delete();
        tmpDir.mkdir();
        return tmpDir;
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:15,代码来源:DefaultTemporaryFileProvider.java

示例6: createManifestClasspath

import org.gradle.util.CollectionUtils; //导入方法依赖的package包/类
public static String createManifestClasspath(File jarFile, Collection<File> classpath) {
    List<String> paths = new ArrayList<String>(classpath.size());
    for (File file : classpath) {
        String path = constructRelativeClasspathUri(jarFile, file);
        paths.add(path);
    }

    return CollectionUtils.join(" ", paths);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:10,代码来源:ManifestUtil.java

示例7: assertCompatibleCacheParameters

import org.gradle.util.CollectionUtils; //导入方法依赖的package包/类
void assertCompatibleCacheParameters(PersistentIndexedCacheParameters parameters) {
    List<String> faultMessages = new ArrayList<String>();

    checkCacheNameMatch(faultMessages, parameters.getCacheName());
    checkCompatibleKeySerializer(faultMessages, parameters.getKeySerializer());
    checkCompatibleValueSerializer(faultMessages, parameters.getValueSerializer());
    checkCompatibleCacheDecorator(faultMessages, parameters.getCacheDecorator());

    if (!faultMessages.isEmpty()) {
        String lineSeparator = SystemProperties.getInstance().getLineSeparator();
        String faultMessage = CollectionUtils.join(lineSeparator, faultMessages);
        throw new InvalidCacheReuseException(
            "The cache couldn't be reused because of the following mismatch:" + lineSeparator + faultMessage);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:16,代码来源:DefaultCacheAccess.java

示例8: createPropertyStringFromList

import org.gradle.util.CollectionUtils; //导入方法依赖的package包/类
private String createPropertyStringFromList(List<String> valueList) {
    return valueList == null || valueList.isEmpty() ? null : CollectionUtils.join(",", valueList);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:DefaultOsgiManifest.java


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