本文整理匯總了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;
}