本文整理汇总了Java中com.intellij.openapi.util.io.FileUtil.normalize方法的典型用法代码示例。如果您正苦于以下问题:Java FileUtil.normalize方法的具体用法?Java FileUtil.normalize怎么用?Java FileUtil.normalize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.util.io.FileUtil
的用法示例。
在下文中一共展示了FileUtil.normalize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: normalize
import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
@Override
protected String normalize(@NotNull String path) {
final int jarSeparatorIndex = path.indexOf(JAR_SEPARATOR);
if (jarSeparatorIndex > 0) {
final String root = path.substring(0, jarSeparatorIndex);
return FileUtil.normalize(root) + path.substring(jarSeparatorIndex);
}
return super.normalize(path);
}
示例2: getExampleClasspath
import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
private List<String> getExampleClasspath() {
myRoot = FileUtil.normalize(myAndroidProject.getRootDir().getPath());
List<String> exampleClassPath =
Lists.newArrayList(myRoot + "/build/intermediates/classes/debug", myRoot + "/build/intermediates/classes/test/debug",
myRoot + "/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.0.0/classes.jar",
myRoot + "/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.0.0/res",
myRoot + "/build/intermediates/exploded-aar/com.android.support/support-v4/22.0.0/classes.jar",
myRoot + "/build/intermediates/exploded-aar/com.android.support/support-v4/22.0.0/libs/internal_impl-22.0.0.jar",
myRoot + "/build/intermediates/exploded-aar/com.android.support/support-v4/22.0.0/res",
"/home/user/.gradle/caches/modules-2/files-2.1/junit/junit/4.12/2973d150c0dc1fefe998f834810d68f278ea58ec/junit-4.12.jar",
"/idea/production/java-runtime", "/idea/production/junit_rt");
myMockableAndroidJar = myRoot + "/build/intermediates/mockable-android-17.jar";
AndroidPlatform androidPlatform = AndroidPlatform.getInstance(myModule);
assertNotNull(androidPlatform);
assertEquals(17, androidPlatform.getApiLevel()); // Sanity check.
myRealAndroidJar = FileUtil.toCanonicalPath(getTestSdkPath() + "/platforms/android-1.5/android.jar");
myResourcesDirs = ImmutableList.of(myRoot + "/build/intermediates/javaResources/debug",
myRoot + "/build/intermediates/javaResources/test/debug");
exampleClassPath.add(0, myMockableAndroidJar);
exampleClassPath.add(0, myRealAndroidJar);
myExampleClassPathSet = ImmutableSet.copyOf(exampleClassPath);
// Sanity check. These should be fixed by the patcher.
assertContainsElements(exampleClassPath, myRealAndroidJar);
assertContainsElements(exampleClassPath, myMockableAndroidJar);
assertDoesntContain(exampleClassPath, myResourcesDirs);
assertFalse(Iterables.getLast(exampleClassPath).equals(myMockableAndroidJar));
return exampleClassPath;
}
示例3: cleanupPath
import com.intellij.openapi.util.io.FileUtil; //导入方法依赖的package包/类
@NotNull
private static String cleanupPath(@NotNull String path, boolean isJar) {
path = FileUtil.normalize(path);
path = trimTrailingSeparators(path, isJar);
return path;
}